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 { types, IAnyModelType, Instance, cast } from "mobx-state-tree"; | |
| import React, { useMemo } from "react"; | |
| export const createModel = <T extends IAnyModelType>( | |
| model: T, | |
| value?: Record<string, any> | |
| ) => types.optional(model, () => model.create(value)); | |
| export function castSelf<IStoreInstance, IParentModel>( | |
| store: IStoreInstance, |
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 { Instance, cast } from 'mobx-state-tree'; | |
| export function castSelf<IStoreInstance, IParentModel>( | |
| store: IStoreInstance, | |
| model: IParentModel | |
| ) { | |
| return cast<Instance<IParentModel>>(store as Instance<IParentModel>); | |
| } |
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 { useLocalStore } from 'mobx-react-lite'; | |
| import { clamp } from 'lodash'; | |
| type Props = { | |
| height: number; | |
| maxHeight?: number; | |
| minWidth: number; | |
| minHeight: number; | |
| measureWidth?: boolean; | |
| measureHeight?: boolean; |
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'; | |
| import { Reveal } from 'styles/reveal'; | |
| import * as T from 'styles/shared-components/text'; | |
| //styles | |
| import * as S from './styles'; | |
| import * as A from 'styles/shared-components'; | |
| import * as L from 'layout-styled-components'; | |
| const AnimatedTitle: React.FC<{ size?: number }> = ({ children='', size = 50 }) => { |
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 { createGlobalStyle, keyframes } from 'styled-components'; | |
| import fadeIn from 'react-animations/lib/fade-in'; | |
| import slideInLeft from 'react-animations/lib/slide-in-left'; | |
| import slideInRight from 'react-animations/lib/slide-in-right'; | |
| export const reveals = { | |
| fadeInUp: 'fade-in-up', | |
| fadeIn: 'fade-in', | |
| slideInLeft: 'slide-in-left', |
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 { VisibilityProperty } from 'csstype'; | |
| import React, { useEffect, useState } from 'react'; | |
| import { useInView } from 'react-intersection-observer'; | |
| import { reveals } from 'styles/reveal-animations'; | |
| import { CSSObject } from 'styled-components'; | |
| export enum RevealMode { | |
| Clone, | |
| Wrap | |
| } |
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, {useEffect, useState} from "react"; | |
| import { useEffect, useState } from "react"; | |
| export const useTimer = (initialValue = 0, duration = 1000, step = 1) => { | |
| const [timer, setTimer] = useState(initialValue); | |
| useEffect(() => { | |
| const interval = setInterval(() => { | |
| setTimer(timer => timer + step); |
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
| .App { | |
| font-family: sans-serif; | |
| } | |
| body { | |
| background-color: rgb(36, 36, 36); | |
| color: white; | |
| } | |
| .article { |
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 data = { | |
| users: [ | |
| { | |
| id: "c91ec707-215c-473d-8187-a0bb06f12b8f", | |
| name: "Lilian Keebler", | |
| email: "Mathew8@gmail.com", | |
| password: "software", | |
| age: 41, | |
| isEmployed: 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
| { | |
| "articles": [ | |
| { | |
| "id": 1, | |
| "title": "Hello world", | |
| "body": "The content of the article" | |
| }, | |
| { | |
| "id": 2, | |
| "title": "Hello there", |