chore(lab): Renamed xray clear to reset
This commit is contained in:
parent
62c5c24a35
commit
9e2babfc7b
3 changed files with 40 additions and 53 deletions
|
@ -1,51 +0,0 @@
|
|||
import { useState } from 'react'
|
||||
import { linkClasses } from 'shared/components/navigation/primary.js'
|
||||
|
||||
const ClearXray = props => {
|
||||
const val = props.gist[props.setting]
|
||||
const dflt = props.dflt
|
||||
|
||||
const [value, setValue] = useState(val)
|
||||
|
||||
const toggle = (evt) => {
|
||||
props.updateGist([props.setting], !value)
|
||||
setValue(!value)
|
||||
}
|
||||
|
||||
return (
|
||||
<li className="flex flex-row">
|
||||
<button className={`
|
||||
flex flex-row
|
||||
w-full
|
||||
justify-between
|
||||
px-2
|
||||
text-left
|
||||
text-base-content
|
||||
sm:text-neutral-content
|
||||
items-center
|
||||
pr-6
|
||||
`} onClick={toggle}>
|
||||
<div className={`
|
||||
grow pl-2 border-l-2
|
||||
${linkClasses}
|
||||
hover:cursor-pointer
|
||||
hover:border-secondary
|
||||
sm:hover:border-secondary-focus
|
||||
text-base-content sm:text-neutral-content
|
||||
`}>
|
||||
<span className={`
|
||||
text-3xl mr-2 inline-block p-0 pl-2 leading-3
|
||||
translate-y-3
|
||||
`}>
|
||||
<>°</>
|
||||
</span>
|
||||
<span>
|
||||
{ props.app.t(`app.reset`) }
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
export default ClearXray
|
|
@ -1,6 +1,6 @@
|
|||
import XrayIcon from 'shared/components/icons/xray.js'
|
||||
import { linkClasses, Chevron } from 'shared/components/navigation/primary.js'
|
||||
import Clear from './clear.js'
|
||||
import Reset from './reset.js'
|
||||
import Disable from './disable.js'
|
||||
import List from './list.js'
|
||||
|
||||
|
@ -43,7 +43,7 @@ const Xray = props => {
|
|||
{props.gist?.xray?.enabled && (
|
||||
<ul className="pl-5 list-inside">
|
||||
<Disable {...props} />
|
||||
<Clear {...props} />
|
||||
<Reset {...props} />
|
||||
{
|
||||
props.gist?.xray?.parts &&
|
||||
Object.keys(props.gist.xray.parts).map(partName => <List {...props} partName={partName} />)
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
import { linkClasses } from 'shared/components/navigation/primary.js'
|
||||
|
||||
const ResetXray = props => (
|
||||
<li className="flex flex-row">
|
||||
<button className={`
|
||||
flex flex-row
|
||||
w-full
|
||||
justify-between
|
||||
px-2
|
||||
text-left
|
||||
text-base-content
|
||||
sm:text-neutral-content
|
||||
items-center
|
||||
pr-6
|
||||
`} onClick={() => props.updateGist(['xray'], { enabled: true })}>
|
||||
<div className={`
|
||||
grow pl-2 border-l-2
|
||||
${linkClasses}
|
||||
hover:cursor-pointer
|
||||
hover:border-secondary
|
||||
sm:hover:border-secondary-focus
|
||||
text-base-content sm:text-neutral-content
|
||||
`}>
|
||||
<span className={`
|
||||
text-3xl mr-2 inline-block p-0 pl-2 leading-3
|
||||
translate-y-3
|
||||
`}>
|
||||
<>°</>
|
||||
</span>
|
||||
<span>
|
||||
{ props.app.t(`app.reset`) }
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
</li>
|
||||
)
|
||||
|
||||
export default ResetXray
|
Loading…
Add table
Add a link
Reference in a new issue