1
0
Fork 0
mirror of https://github.com/elementor/hello-theme.git synced 2026-07-30 15:16:56 +08:00
hello-theme/modules/admin-home/assets/js/components/settings/setting.js
Rami Yushuvaev aa9eed2933
Some checks failed
Build / Build theme (push) Failing after 1s
Lint / ESLint (push) Failing after 0s
PHPUnit / File Diff (push) Failing after 1s
Lint / PHPCS (push) Failing after 41s
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 7.4 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.0 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.1 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.2 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.8 - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress 6.9 - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress latest - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - WordPress nightly - PHP version 8.3 (push) Has been skipped
PHPUnit / PHPUnit - Test Results (push) Successful in 2s
Internal: Setup prettier and fix all lint/format issues [TMZ-1051] (#671)
* Setup prettier

* Fix lint/format issues
2026-07-01 00:41:16 -07:00

66 lines
1.5 KiB
JavaScript

import Stack from '@elementor/ui/Stack';
import Box from '@elementor/ui/Box';
import Typography from '@elementor/ui/Typography';
import Switch from '@elementor/ui/Switch';
export const Setting = ({
label,
value,
onSwitchClick,
code,
description,
tip,
}) => {
return (
<Stack direction="column" spacing={2}>
<Stack direction="row" spacing={2}>
<Box sx={{ minWidth: 80, height: 38 }}>
<Box
display="inline-flex"
alignItems="center"
justifyContent="center"
height="100%"
>
<Switch onClick={onSwitchClick} checked={value} />
</Box>
</Box>
<Box sx={{ height: 38, width: '100%' }}>
<Box
display="flex"
alignItems="center"
justifyContent="flex-start"
height="100%"
width="fit-content"
>
<Typography variant="subtitle1" sx={{ fontWeight: 500 }}>
{label}
</Typography>
</Box>
</Box>
</Stack>
<Stack direction="row" spacing={2}>
<Box sx={{ minWidth: 80 }}>
<Box height="100%" />
</Box>
<Box sx={{ width: '100%' }}>
<Box height="100%">
<Typography variant="body1" sx={{ py: 1, fontWeight: 400 }}>
{description}
</Typography>
<Typography variant="body2" sx={{ py: 1, mb: 2, fontWeight: 400 }}>
{tip}
</Typography>
<Typography
component="code"
color="text.tertiary"
variant="body2"
sx={{ fontFamily: 'Courier New' }}
>
{code}
</Typography>
</Box>
</Box>
</Stack>
</Stack>
);
};