0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Removed page color in signup form Storybook preview component

no issue

The Storybook did set the color, but that shouldn't be set because normally the components are always rendered in an iframe, with a default black, unchangeable color.
This commit is contained in:
Simon Backx 2023-06-08 13:16:59 +02:00
parent 887f7385e1
commit a1e632abe0

View file

@ -9,9 +9,8 @@ import type {PlayFunction} from '@storybook/types';
const Preview: React.FC<SignupFormOptions & { const Preview: React.FC<SignupFormOptions & {
pageBackgroundColor: string pageBackgroundColor: string
pageTextColor: string
simulateApiError: boolean simulateApiError: boolean
}> = ({simulateApiError, pageBackgroundColor, pageTextColor, ...options}) => { }> = ({simulateApiError, pageBackgroundColor, ...options}) => {
const [page, setPage] = useState<Page>({ const [page, setPage] = useState<Page>({
name: 'FormPage', name: 'FormPage',
data: {} data: {}
@ -46,7 +45,7 @@ const Preview: React.FC<SignupFormOptions & {
options, options,
scriptTag: document.createElement('div') scriptTag: document.createElement('div')
}}> }}>
<div style={{width: '100%', height: '100%', backgroundColor: pageBackgroundColor, color: pageTextColor}}> <div style={{width: '100%', height: '100%', backgroundColor: pageBackgroundColor}}>
<ContentBox> <ContentBox>
<PageComponent {...data} /> <PageComponent {...data} />
</ContentBox> </ContentBox>
@ -79,7 +78,7 @@ export const Full: Story = {
args: { args: {
title: 'Signup Forms Weekly', title: 'Signup Forms Weekly',
description: 'An independent publication about embeddable signup forms.', description: 'An independent publication about embeddable signup forms.',
logo: 'https://user-images.githubusercontent.com/65487235/157884383-1b75feb1-45d8-4430-b636-3f7e06577347.png', icon: 'https://user-images.githubusercontent.com/65487235/157884383-1b75feb1-45d8-4430-b636-3f7e06577347.png',
backgroundColor: '#eeeeee', backgroundColor: '#eeeeee',
textColor: '#000000', textColor: '#000000',
buttonColor: '#ff0095', buttonColor: '#ff0095',
@ -88,7 +87,6 @@ export const Full: Story = {
labels: ['label-1', 'label-2'], labels: ['label-1', 'label-2'],
simulateApiError: false, simulateApiError: false,
pageBackgroundColor: '#ffffff', pageBackgroundColor: '#ffffff',
pageTextColor: '#000000',
locale: 'en' locale: 'en'
}, },
@ -103,7 +101,6 @@ export const Minimal: Story = {
buttonTextColor: '#ffffff', buttonTextColor: '#ffffff',
simulateApiError: false, simulateApiError: false,
pageBackgroundColor: '#ffffff', pageBackgroundColor: '#ffffff',
pageTextColor: '#000000',
locale: 'en' locale: 'en'
}, },
@ -118,7 +115,6 @@ export const MinimalOnDark: Story = {
buttonTextColor: '#ffffff', buttonTextColor: '#ffffff',
simulateApiError: false, simulateApiError: false,
pageBackgroundColor: '#122334', pageBackgroundColor: '#122334',
pageTextColor: '#f7f7f7',
locale: 'en' locale: 'en'
}, },