This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<title>App</title> | |
<meta name="Description" content="Best application ever" /> | |
<meta charset="utf-8" /> | |
<meta name="theme-color" content="#333333" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> | |
<link rel="shortcut icon" href="/favicon.ico" /> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<title>App</title> | |
<meta name="Description" content="Best application ever" /> | |
<meta charset="utf-8" /> | |
<meta name="theme-color" content="#333333" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> | |
<link rel="shortcut icon" href="/favicon.ico" /> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const categories = useMemo(() => { | |
return products.reduce((categories, { category }) => { | |
return !category || categories.find(({ id }) => category && category.id === id) | |
? categories | |
: [ | |
...categories, | |
{ | |
id: category.id, | |
value: category.id, | |
label: category.title, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CreateAccountForm = () => { | |
const [password, setPassword] = useState(''); | |
const [showErrors, setShowErrors] = useState(false); | |
const checkPassword = event => { | |
const { value } = event.target; | |
setShowErrors(value.length < 8); | |
setPassword(value); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usando classe | |
class Counter extends Component { | |
state = { | |
counter: 1, | |
} | |
incrementCounter = () => { | |
this.setState(({ counter }) => ({ counter: counter + 1 })); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rules = [ | |
'8 characteres', | |
'lowercase word', | |
'uppercase word', | |
]; | |
// Lista de erros | |
const Errors = ({ active }) => { | |
return active && ( | |
<ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Editor configuration, see https://editorconfig.org | |
root = true | |
[*] | |
charset = utf-8 | |
indent_style = space | |
indent_size = 4 | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Edit the follow file: vendor/magento/framework/App/Action/Action.php | |
public function __construct(Context $context) | |
{ | |
// ... // | |
$this->messageManager->addError(__('Error message.')); | |
$this->messageManager->addSuccessMessage(__('Success message.')); | |
$this->messageManager->addWarning(__('Warning message.')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// vendor/magento/module-checkout/Controller/Onepage/Success.php | |
// or app/code/Magento/Checkout/Controller/Onepage/Success.php | |
// Comment the follow line | |
$session->clearQuote(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this code on your browser console | |
localStorage.removeItem("mage-translation-file-version") |