diff --git a/api/hasura/actions/_handlers/updateUser.ts b/api/hasura/actions/_handlers/updateUser.ts index 937e8bcd78..f6e503c65d 100644 --- a/api/hasura/actions/_handlers/updateUser.ts +++ b/api/hasura/actions/_handlers/updateUser.ts @@ -53,7 +53,6 @@ async function handler(req: VercelRequest, res: VercelResponse) { } // Update the state after all external validations have passed - const mutationResult = await adminClient.mutate( { update_users: [ diff --git a/package.json b/package.json index de2840fe48..1075d285a6 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@typeform/embed-react": "^1.18.0", "@types/morgan": "^1.9.3", "@types/react-helmet": "^6.1.5", + "@uiw/react-markdown-preview": "^4.1.5", "@web3-react/core": "6.1.9", "@web3-react/injected-connector": "6.0.7", "@web3-react/walletconnect-connector": "6.2.13", diff --git a/src/pages/GivePage/EpochStatementDrawer.tsx b/src/pages/GivePage/EpochStatementDrawer.tsx index c2c2743535..48f6e02506 100644 --- a/src/pages/GivePage/EpochStatementDrawer.tsx +++ b/src/pages/GivePage/EpochStatementDrawer.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import { updateUser } from 'lib/gql/mutations'; import debounce from 'lodash/debounce'; @@ -8,7 +8,16 @@ import { NavLink } from 'react-router-dom'; import { ApeInfoTooltip } from '../../components'; import { Check, X } from '../../icons/__generated'; import { paths } from 'routes/paths'; -import { Avatar, Box, Button, Flex, Text, TextArea, ToggleButton } from 'ui'; +import { + Avatar, + Box, + Button, + Flex, + Text, + TextArea, + ToggleButton, + MarkdownPreview, +} from 'ui'; import { SaveState, SavingIndicator } from 'ui/SavingIndicator'; import { Member } from './'; @@ -67,6 +76,7 @@ export const EpochStatementDrawer = ({ // saveTimeout is the timeout handle for the buffered async saving const [saving, setSaving] = useState('stable'); + const [showMarkdown, setShowMarkDown] = useState(true); const { mutate: updateEpochStatement } = useMutation( async (bio: string) => updateUser({ circle_id: member.circle_id, bio }), @@ -100,6 +110,12 @@ export const EpochStatementDrawer = ({ [saveStatement] ); + useEffect(() => { + if (!showMarkdown) { + document?.getElementById('epoch_statement')?.focus(); + } + }, [showMarkdown]); + return ( Epoch Statement -