Skip to content

Commit

Permalink
OUT-859 Update default client home preferences (#75)
Browse files Browse the repository at this point in the history
* feat: updates default banner image and bg color

* feat: updates background color in client-preview

* feat: updates background color in client-preview
  • Loading branch information
aatbip authored Oct 1, 2024
1 parent e813615 commit 1926a67
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
Binary file added public/images/default_bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/app/client-preview/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { z } from 'zod'
import { CopilotAPI } from '@/utils/copilotApiUtils'
import InvalidToken from '../components/InvalidToken'
import { defaultState } from '../../../defaultState'
import { defaultBannerImagePath, defaultBgColor } from '@/utils/constants'

export const revalidate = 0

Expand Down Expand Up @@ -60,7 +61,7 @@ export default async function ClientPreviewPage({

let settings: ISettings = {
content: defaultState,
backgroundColor: '#ffffff',
backgroundColor: defaultBgColor,
id: '',
bannerImage: {
id: '',
Expand Down Expand Up @@ -123,7 +124,7 @@ export default async function ClientPreviewPage({
const htmlContent = template({ client })

const bannerImgUrl = !defaultSetting
? '/images/default_banner.png'
? defaultBannerImagePath
: settings?.bannerImage?.url

return (
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/ClientPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { defaultState } from '../../../defaultState'
import useSWR from 'swr'
import { fetcher } from '@/utils/fetcher'
import { IframeExtension } from '@/components/tiptap/iframe/ext_iframe'
import { defaultBgColor } from '@/utils/constants'

const ClientPreview = ({
content,
Expand Down Expand Up @@ -134,7 +135,7 @@ const ClientPreview = ({
appState?.toggleReadOnly(true)
const _settings = {
content: defaultState,
backgroundColor: '#ffffff',
backgroundColor: defaultBgColor,
id: '',
bannerImage: {
id: '',
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/EditorInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { defaultState } from '../../../defaultState'
import Image from 'next/image'
import { Box } from '@mui/material'
import { Delete } from '@mui/icons-material'
import { defaultBannerImagePath } from '@/utils/constants'
import { defaultBannerImagePath, defaultBgColor } from '@/utils/constants'
import { AutofillExtension } from '@/components/tiptap/autofieldSelector/ext_autofill'
import { NotificationWidgetExtension } from '@/components/tiptap/notificationWidget/ext_notification_widget'
import { useAppDataContext } from '@/hooks/useAppData'
Expand Down Expand Up @@ -264,7 +264,7 @@ const EditorInterface = ({ settings, token, font }: IEditorInterface) => {
if (token) {
const _settings: ISettings = {
content: defaultState,
backgroundColor: '#ffffff',
backgroundColor: defaultBgColor,
id: '',
bannerImage: {
id: '',
Expand Down
4 changes: 3 additions & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export const staticAutofillValues = [
'{{client.company}}',
]

export const defaultBannerImagePath = '/images/default_banner.png'
export const defaultBannerImagePath = '/images/default_bg.jpg'

export const defaultBgColor = '#f7f8fa'

0 comments on commit 1926a67

Please sign in to comment.