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 { Fragment, useRef, useState } from 'react' | |
| import { Link } from 'react-router-dom' | |
| import styled from 'styled-components' | |
| import { ToastContainer, toast } from 'react-toastify' | |
| import 'react-toastify/dist/ReactToastify.css' | |
| // constants | |
| import { images } from '../../constants' | |
| const SignUp = () => { |
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 { createContext, useContext, useState, useEffect } from "react" | |
| const StateContext = createContext({ | |
| userData: {}, | |
| setUserData: () => {}, | |
| updateUserData: () => {}, | |
| }) | |
| export const ContextProvider = ({ children }) => { | |
| const [userData, setUserData] = useState(JSON.parse(localStorage.getItem('user_data'))) |
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 { Dimensions } from "react-native" | |
| const { height, width } = Dimensions.get('window') | |
| const setHeight = h => (height / 100) * h | |
| const setWidth = w => (width / 100) * w | |
| export default { setHeight, setWidth } |
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 os = require('os') | |
| function getIPAddress() { | |
| const networkInterfaces = os.networkInterfaces() | |
| let ipAddress = '' | |
| // Iterate over network interfaces | |
| Object.keys(networkInterfaces).forEach(interfaceName => { | |
| const interfaces = networkInterfaces[interfaceName] | |
| // Find the first non-internal and IPv4 address |
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 { View } from 'react-native' | |
| export default function Separator({ height, width, ...extraProps }) { | |
| return ( | |
| <View style={{height: height, width: width}} /> | |
| ) | |
| } | |
| Separator.defaultProps = { | |
| height: 0, |
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 { StatusBar } from "react-native" | |
| import { useIsFocused } from "@react-navigation/native" | |
| const FocusedStatusBar = (props) => { | |
| const isFocused = useIsFocused() | |
| return isFocused ? <StatusBar animated={true} {...props} /> : null | |
| } | |
| export default FocusedStatusBar |
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 { useState, useEffect } from "react" | |
| import axios from "axios" | |
| const API_KEY = process.env.API_KEY | |
| const useFetch = (endpoint, query) => { | |
| const [date, setData] = useState([]) | |
| const [isLoading, setIsLoading] = useState(false) | |
| const [error, setError] = useState(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
| const COLORS = { | |
| primary: "#312651", | |
| secondary: "#444262", | |
| tertiary: "#FF7754", | |
| gray: "#83829A", | |
| gray2: "#C1C0C8", | |
| white: "#F3F4F8", | |
| lightWhite: "#FAFAFC", |
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
| let today = new Date() | |
| let day = `${today.getDate() < 10 ? '0' : ''} ${today.getDate()}` | |
| // month are counted from 0 | |
| let month = `${(today.getMonth() + 1) < 10 ? '0' : ''} ${today.getMonth()}` | |
| let year = today.getFullYear() | |
| console.log(`Current Date: ${day}/${month}/${year}`); |
NewerOlder