-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme): ✨ Add custom css settings
- Loading branch information
1 parent
b0abe5b
commit 21448bc
Showing
9 changed files
with
88 additions
and
28 deletions.
There are no files selected for viewing
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
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
17 changes: 17 additions & 0 deletions
17
apps/builder/components/theme/CustomCssSettings/CustomCssSettings.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { CodeEditor } from 'components/shared/CodeEditor' | ||
import React from 'react' | ||
|
||
type Props = { | ||
customCss?: string | ||
onCustomCssChange: (css: string) => void | ||
} | ||
|
||
export const CustomCssSettings = ({ customCss, onCustomCssChange }: Props) => { | ||
return ( | ||
<CodeEditor | ||
value={customCss ?? ''} | ||
lang="css" | ||
onChange={onCustomCssChange} | ||
/> | ||
) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { getIframeBody } from 'cypress/support' | ||
|
||
describe('Custom CSS settings', () => { | ||
beforeEach(() => { | ||
cy.task('seed') | ||
cy.signOut() | ||
}) | ||
|
||
it('should reflect changes in real time', () => { | ||
cy.loadTypebotFixtureInDatabase('typebots/theme/theme.json') | ||
cy.signIn('test2@gmail.com') | ||
cy.visit('/typebots/typebot4/theme') | ||
cy.findByRole('button', { name: 'Custom CSS' }).click() | ||
|
||
cy.findByTestId('code-editor').type( | ||
'.typebot-button {background-color: green}', | ||
{ | ||
parseSpecialCharSequences: false, | ||
} | ||
) | ||
getIframeBody() | ||
.findByTestId('button') | ||
.should('have.css', 'background-color') | ||
.should('eq', 'rgb(0, 128, 0)') | ||
}) | ||
}) |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export type Theme = { | ||
general?: GeneralTheme | ||
chat?: ChatTheme | ||
customCss?: string | ||
} | ||
|
||
export type GeneralTheme = { | ||
|
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
21448bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2 – ./apps/viewer
typebot-io.vercel.app
viewer-v2-git-main-typebot-io.vercel.app
viewer-v2-typebot-io.vercel.app
21448bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
next.typebot.io