This file contains 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 { useDisclosure } from "@chakra-ui/react"; | |
import ConfirmDialog from "app/core/chakra-prompts/ConfirmDialog"; | |
import FormPrompt from "app/core/chakra-prompts/FormPrompt"; | |
import React, { useContext, useState } from "react"; | |
const ChakraPromptsContext = React.createContext<any>(null); | |
export const useChakraPrompts = () => useContext(ChakraPromptsContext); | |
const Manager = ({ children }) => { | |
const [config, setConfig] = useState<any>({}); |
This file contains 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 { useToast } from "@chakra-ui/react"; | |
import { exists } from "app/core/utils/js-utils"; | |
import { QueryFn, useMutation } from "blitz"; | |
import { MutationOptions } from "react-query"; | |
type ShowLoginOnFailFn = (s: any) => boolean; | |
type CustomOptions = { | |
errorMessage?: string; | |
showLoginOnFail?: boolean | ShowLoginOnFailFn; |
This file contains 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 Head from 'next/head'; | |
import React from 'react'; | |
import { isDev } from 'utils/is-prod'; | |
const prefix = isDev ? 'http://localhost:3004' : 'https://kitze.io'; | |
const getImage = (url) => `${prefix}/${url}`; | |
const Meta: React.FC<{ | |
title?: string; |
This file contains 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 flex from '../../styles/flex'; | |
import { absoluteCorner, fixedSize } from 'styled-mixins'; | |
const textColor = `#e0e0e0`; | |
const Bio = ({ styles }) => { | |
return ( | |
<div | |
style={{ |
This file contains 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 { cloud } from 'app/config/cloudinary'; | |
import { GetCloudinarySignatureSchema } from 'app/data/images/schema'; | |
import { protect } from 'app/utils/auth-utils'; | |
import { Role } from 'app/utils/enums'; | |
import { getEnv } from 'app/utils/get-env'; | |
export default protect( | |
{ schema: GetCloudinarySignatureSchema, role: Role.User }, | |
async function getCloudinarySignature({ publicId, folder }) { | |
const timestamp = Math.round(new Date().getTime() / 1000); |
This file contains 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 { Box as OriginalBox } from "@chakra-ui/core"; | |
import { PseudoBox } from "@chakra-ui/core/dist"; | |
import React from "react"; | |
import styled from "@emotion/styled"; | |
import flex from "styles/flex"; | |
import { fixedHeight, fixedWidth } from "styled-mixins"; | |
import { gridProps, grid } from "styled-mixins"; | |
export interface CommonProps { | |
wrap?: boolean; |
This file contains 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 TrainingView = () => { | |
const trainingSlug = useSingleParam(routeParams.TrainingSlug); | |
const result = useTrainingViewQuery({ | |
variables: { | |
slug: trainingSlug | |
} | |
}); | |
return useHandleData(result)(({ me: { trainingSessions } }) => { | |
let [trainingSession] = trainingSessions; |
This file contains 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 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 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; |