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
| import React, { Component } from 'react'; | |
| class JQueryToReact extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| isShow: false | |
| } | |
| } |
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
| import React, { Component } from 'react'; | |
| import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom'; | |
| import { PrivateRoute } from 'react-router-with-props'; | |
| class App extends Component { | |
| state = { | |
| // Verifica se o item 'token' existe no localStorage |
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
| import React, { Component } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import TextField from '@material-ui/core/TextField'; | |
| export class EmailTextField extends Component { | |
| state = { | |
| error: undefined | |
| } |
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
| function randomDate(start, end) { | |
| return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime())); | |
| } | |
| console.log(randomDate(new Date(2012, 0, 1), new Date())); |
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
| function hexToRgb(hex, transparency) { | |
| var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
| const r = parseInt(result[1], 16); | |
| const g = parseInt(result[2], 16); | |
| const b = parseInt(result[3], 16); | |
| return transparency ? `rgba(${r}, ${g}, ${b}, ${transparency})` : `rgb(${r}, ${g}, ${b})` | |
| } | |
| export default hexToRgb; |
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
| .text-avatar{ | |
| display: block; | |
| font-size: 12px; | |
| font-weight: 700; | |
| height: 32px; | |
| left: 0; | |
| line-height: 32px; | |
| overflow: hidden; | |
| position: absolute; | |
| text-align: center; |
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
| :root{ | |
| --primary-color: blue; | |
| --secondary-color: purple; | |
| } |
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
| .text-primary{ | |
| color: var(--primary-color); | |
| } | |
| .text-secondary{ | |
| color: var(--secondary-color); | |
| } |
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
| <html> | |
| <head> | |
| <title>Invert color on mouse position change</title> | |
| </head> | |
| <body style="display: flex; margin: 0px;"> | |
| <div id="scroll" style="height: 52px;width: 52px;filter: invert(100%);position: absolute;background: #000;border-radius: 100%;"></div> | |
| <div style="background: pink; height: 100vh; width: 50vw"></div> | |
| <div style="background: yellow; height: 100vh; width: 50vw"></div> | |
| </body> | |
| <script> |
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 DataTable = ({ data }) => { | |
| const [items, setItems] = useState(); | |
| const remove = () => { | |
| ///... | |
| } | |
| const fetchMoreData = () => { | |
| setTimeout(() => { | |
| setItems([data, ...data]) |
OlderNewer