-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: #781 I want to click button to arrange a viewing with Estate Agent * chore: #781 update style * chore: add some test * chore: #781 update theme class * chore: #781 update styles Co-authored-by: andt <[email protected]>
- Loading branch information
1 parent
e60f927
commit c6ccb5d
Showing
21 changed files
with
1,100 additions
and
154 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
22 changes: 22 additions & 0 deletions
22
packages/web-components/src/common/styles/__themes__/viewing-booking.js
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,22 @@ | ||
const defaultVariant = { | ||
baseBackgroundColor: '#f9fbfd', | ||
basefontSize: '16px', | ||
basefontColor: '#12263f', | ||
inverseFontColor: '#f9fbfd', | ||
secondaryfontColor: '#1e2554', | ||
primaryHeadingFontSize: '24px', | ||
secondaryHeadingFontSize: '20px', | ||
baseFontFamily: '"Roboto", sans-serif', | ||
headingFontFamily: '"Open Sans", sans-serif', | ||
primaryAccentColor: '#0061a8', | ||
secondaryAccentColor: '#6c757d', | ||
mapAccentColor: '#7bc9eb', | ||
breakPoints: { | ||
mobile: '', | ||
tablet: '', | ||
laptop: '', | ||
desktop: '', | ||
}, | ||
} | ||
|
||
window.theme = defaultVariant |
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
19 changes: 19 additions & 0 deletions
19
packages/web-components/src/common/utils/__tests__/validate.ts
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,19 @@ | ||
import { validateEmail } from '../validate' | ||
|
||
describe('validate email', () => { | ||
it('should return true', () => { | ||
const mail = '[email protected]' | ||
expect(validateEmail(mail)).toBe(true) | ||
}) | ||
|
||
it('should return false', () => { | ||
let mail = 'abcedf.com' | ||
expect(validateEmail(mail)).toBe(false) | ||
|
||
mail = '[email protected]' | ||
expect(validateEmail(mail)).toBe(false) | ||
|
||
mail = 'abc@edf' | ||
expect(validateEmail(mail)).toBe(false) | ||
}) | ||
}) |
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,5 @@ | ||
export function validateEmail(email: string) { | ||
//eslint-disable-next-line | ||
const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ | ||
return regex.test(email) | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/web-components/src/scripts/rollup.config.viewing-booking.js
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,30 @@ | ||
import svelte from 'rollup-plugin-svelte' | ||
import baseConfig from './rollup.config.base' | ||
import replace from '@rollup/plugin-replace' | ||
import path from 'path' | ||
|
||
const config = require(path.resolve(__dirname, '../..', 'config.json')) | ||
const production = !process.env.ROLLUP_WATCH | ||
|
||
export default { | ||
...baseConfig, | ||
input: 'src/viewing-booking/client/core/index.ts', | ||
output: { | ||
sourcemap: !production, | ||
format: 'iife', | ||
name: 'app', | ||
file: './public/dist/viewing-booking.js', | ||
}, | ||
plugins: [ | ||
svelte({ | ||
dev: !production, | ||
css: css => { | ||
css.write('./public/dist/viewing-booking.css') | ||
}, | ||
}), | ||
replace({ | ||
'process.env.NODE_ENV': JSON.stringify(config.NODE_ENV), | ||
}), | ||
...baseConfig.plugins, | ||
], | ||
} |
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
Oops, something went wrong.