Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add initial tooltip for public paste #269

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"5_minutes": "5 minutes",
"successful_share": "Successful share",
"get_your_secret": "Get your secret at hemmelig.app.",
"set_public": "Set as a public paste"
"set_public": "Set as a public paste",
"what_is_public": "A public paste is a paste that is visible to everyone. You can find all the public pastes at hemmelig.app/public, or in the menu."
},
"secret": {
"view_your_secret": "View your secret",
Expand Down
37 changes: 29 additions & 8 deletions src/client/routes/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
IconLink,
IconLock,
IconLockAccess,
IconQuestionMark,
IconShare,
IconShieldLock,
IconSquarePlus,
Expand Down Expand Up @@ -72,6 +73,7 @@ const Home = () => {
const [creatingSecret, setCreatingSecret] = useState(false);
const [error, setError] = useState('');
const [isPublic, setIsPublic] = useState(false);
const [togglePublicTooltip, setTogglePublicTooltip] = useState(false);

const secretRef = useRef(null);

Expand Down Expand Up @@ -398,14 +400,33 @@ const Home = () => {
</Group>

<Group grow>
<Checkbox
styles={groupMobileStyle}
checked={isPublic}
onChange={onSetPublic}
readOnly={inputReadOnly}
color="hemmelig"
label={t('home.set_public')}
/>
<Group>
<Checkbox
styles={groupMobileStyle}
checked={isPublic}
onChange={onSetPublic}
readOnly={inputReadOnly}
color="hemmelig"
label={t('home.set_public')}
/>
<Tooltip
multiline
withArrow
w={220}
transitionProps={{ duration: 200 }}
label={t('home.what_is_public')}
opened={togglePublicTooltip}
>
<ActionIcon
variant="outline"
color="gray"
size="sm"
onClick={() => setTogglePublicTooltip((open) => !open)}
>
<IconQuestionMark />
</ActionIcon>
</Tooltip>
</Group>

<FileButton
disabled={disableFileUpload}
Expand Down
Loading