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, {useState} from 'react'; | |
| const LightBox = ({children, src, alt, Wrapper = 'div'}) => { | |
| const [ isOpen, setIsOpen ] = useState(false); | |
| const toggleIsOpen = () => { | |
| setIsOpen(!isOpen); | |
| }; | |
| return ( |
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, {useState} from 'react'; | |
| const LightBox = ({children, src, alt, Wrapper = 'div'}) => { | |
| const [ isOpen, setIsOpen ] = useState(false); | |
| return ( | |
| <Wrapper> | |
| </Wrapper> | |
| ); |
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 from 'react'; | |
| const LightBox = ({children, src, alt, Wrapper = 'div'}) => { | |
| return ( | |
| <Wrapper> | |
| </Wrapper> | |
| ); | |
| }; |
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 from 'react'; | |
| const LightBox = () => { | |
| return ( | |
| <div> | |
| </div> | |
| ); | |
| }; |
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
| class DB { | |
| private _connection: MongoClient; | |
| private _db: Db; | |
| constructor() {} | |
| public async connect() { | |
| const mongoClientPromise = MongoClient.connect(process.env.MONGODB_URI, { useNewUrlParser: true, useUnifiedTopology: true }); | |
| this._connection = await mongoClientPromise; | |
| this._db = this._connection.db(process.env.MONGODB_NAME); | |
| } |
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
| class DB { | |
| private _connection: AWS.DynamoDB.DocumentClient; | |
| constructor() { | |
| this._connection = new AWS.DynamoDB.DocumentClient(); | |
| } | |
| } |
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 params = { | |
| TableName: 'users', | |
| FilterExpression: 'phone = :phone, email = :email', | |
| ExpressionAttributeValues: { | |
| phone: phoneNumber, | |
| email: emailAddress | |
| } | |
| }; | |
| const result = await docClient.scan(params).promise(); |
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 docClient = new AWS.DynamoDB.DocumentClient(); | |
| var params = { | |
| TableName: 'users', | |
| Key: { | |
| "email": emailAddress, | |
| "phone": phoneNumber | |
| } | |
| }; |
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 result = await mongoClient.collection('users').findOne({ | |
| email: emailAddress, | |
| phone: phoneNumber | |
| }); |
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
| // en.json | |
| { | |
| "items": [ | |
| { | |
| title: "abc" | |
| }, | |
| { | |
| title: "def" | |
| } | |
| ] |