@@ -2,9 +2,7 @@ import React, { useState } from 'react'
22
33import Divider from '../../react/Divider'
44import Paper from '../../react/Paper'
5- import Typography from '../../react/Typography'
65import Button from '../../react/deprecated/Button' // TODO: should remove deprecated
7- import isTesting from '../../react/helpers/isTesting'
86import CozyTheme from '../../react/providers/CozyTheme'
97import { isUsingDevStyleguidist } from '../../scripts/build-utils'
108
@@ -30,25 +28,16 @@ const styles = {
3028}
3129
3230export default ( { children } ) => {
33- const [ variant , setVariant ] = useState (
34- localStorage . getItem ( 'ui-theme-variant' ) || 'normal'
35- )
3631 const [ lang , setLang ] = useState ( localStorage . getItem ( 'lang' ) || 'en' )
3732
38- const otherVariant = variant === 'normal' ? 'inverted' : 'normal'
39-
40- const handleVariantClick = ( ) => {
41- setVariant ( otherVariant )
42- }
43-
4433 const handleLangClick = ( ) => {
4534 const newLang = lang === 'fr' ? 'en' : 'fr'
4635 setLang ( newLang )
4736 localStorage . setItem ( 'lang' , newLang )
4837 }
4938 return (
5039 < CozyTheme >
51- < CozyTheme variant = { variant } >
40+ < CozyTheme >
5241 < Paper className = "u-pos-relative u-p-1" elevation = { 0 } square >
5342 < Button
5443 size = "tiny"
@@ -57,31 +46,14 @@ export default ({ children }) => {
5746 style = { styles . buttonLang }
5847 onClick = { handleLangClick }
5948 />
60- { isTesting ( ) || isUsingDevStyleguidist ( ) ? null : (
61- < Button
62- size = "tiny"
63- theme = "secondary"
64- label = { variant }
65- style = { styles . button }
66- onClick = { handleVariantClick }
67- />
68- ) }
69- { isUsingDevStyleguidist ( ) && (
70- < Typography component = "div" className = "u-db u-mb-1" variant = "h5" >
71- Variant: { variant }
72- </ Typography >
73- ) }
7449 { children }
7550 </ Paper >
7651 </ CozyTheme >
7752 { isUsingDevStyleguidist ( ) && (
7853 < >
7954 < Divider />
80- < CozyTheme variant = { otherVariant } >
55+ < CozyTheme >
8156 < Paper className = "u-pos-relative u-p-1" elevation = { 0 } square >
82- < Typography component = "div" className = "u-db u-mb-1" variant = "h5" >
83- Variant: { otherVariant }
84- </ Typography >
8557 { children }
8658 </ Paper >
8759 </ CozyTheme >
0 commit comments