1
0
Fork 0

chore(lab): Use locale and hover resize consistently

This commit is contained in:
Joost De Cock 2022-01-27 18:07:37 +01:00
parent 2380b4f2db
commit e8d747a949
18 changed files with 162 additions and 96 deletions

View file

@ -10,13 +10,13 @@ import defaultSettings from 'shared/components/workbench/default-settings.js'
// Generates a default pattern gist to start from
const defaultGist = (pattern, language='en') => {
const defaultGist = (pattern, locale='en') => {
const gist = {
design: pattern.config.name,
version: pattern.config.version,
settings: defaultSettings
...defaultSettings
}
if (language) gist.settings.locale = language
if (locale) gist.locale = locale
return gist
}
@ -41,7 +41,7 @@ const WorkbenchWrapper = ({ app, pattern }) => {
// State for display mode and gist
const [mode, setMode] = useState('measurements')
const [gist, setGist] = useLocalStorage('gist', defaultGist(pattern, app.language))
const [gist, setGist] = useLocalStorage('gist', defaultGist(pattern, app.locale))
// If we don't have the requiremed measurements,
// force mode to measurements