Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add theme for remirror and update some copies #905

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/config/theme.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
import { extendTheme, StyleFunctionProps } from '@chakra-ui/react'
import { RemirrorThemeType } from 'remirror'

import { colors, fonts, neutralColors, primaryColors } from '../styles'

export const remirrorTheme: RemirrorThemeType = {
color: {
text: colors.neutral900,
background: colors.neutral0,
primary: colors.primary400,
primaryText: colors.neutral900,
hover: {
background: colors.neutral100,
primary: colors.primary400,
},
secondary: colors.primary400,
secondaryText: colors.neutral900,
border: colors.neutral200,
outline: colors.primary400,
},
}

jfrader marked this conversation as resolved.
Show resolved Hide resolved
export const theme = extendTheme({
initialColorMode: 'light',
breakpoints: {
Expand Down
12 changes: 8 additions & 4 deletions src/forms/components/MarkdownField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ import {
import { AllStyledComponent } from '@remirror/styles/emotion'
import { PropsWithChildren, useCallback } from 'react'
import { Control, useController } from 'react-hook-form'
import { getRemirrorJSON, InvalidContentHandler } from 'remirror'
import {
ExtensionPriority,
getRemirrorJSON,
InvalidContentHandler,
} from 'remirror'
import {
BlockquoteExtension,
BoldExtension,
Expand All @@ -48,6 +52,7 @@ import {
} from 'remirror/extensions'
import TurndownService from 'turndown'

import { remirrorTheme } from '../../config'
import { useSignedUpload } from '../../hooks'

const turndownService = new TurndownService()
Expand Down Expand Up @@ -102,7 +107,6 @@ export const MarkdownField = ({
new HeadingExtension(),
new BlockquoteExtension(),
new OrderedListExtension(),
new ListItemExtension(),
new CodeExtension(),
new IframeExtension(),
new HardBreakExtension(),
Expand Down Expand Up @@ -170,8 +174,8 @@ export const MarkdownField = ({
const RemirrorStyleProvider = ({ children }: PropsWithChildren) => {
return (
<Box width="100%">
<AllStyledComponent>
<ThemeProvider>{children}</ThemeProvider>
<AllStyledComponent theme={remirrorTheme}>
<ThemeProvider theme={remirrorTheme}>{children}</ThemeProvider>
</AllStyledComponent>
</Box>
)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projectCreate/ProjectCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const ProjectCreate = () => {
onBackClick={onBackClick}
title={
<TitleWithProgressBar
title="Project description"
title="Story"
subtitle="Create a project"
index={1}
length={4}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ export const ProjectPreviewComponent = ({
<H3 wordBreak="break-all">
{data.shortDescription || 'Project Objective'}
</H3>
<MarkdownField
preview
content={data.description || 'Project Description'}
/>
<MarkdownField preview content={data.description || 'Story'} />
jfrader marked this conversation as resolved.
Show resolved Hide resolved
</VStack>
</Card>
</VStack>
Expand Down