This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from ergomake/paste-env
support paste of a .env file to env vars form
- Loading branch information
Showing
3 changed files
with
313 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { useCallback, useState } from 'react' | ||
|
||
interface Props extends React.HTMLAttributes<unknown> { | ||
startHidden?: boolean | ||
} | ||
function HidableSpan(props: Props) { | ||
const { startHidden, ...spanProps } = props | ||
const [hidden, setHidden] = useState(props.startHidden ?? false) | ||
|
||
const onToggle = useCallback(() => { | ||
setHidden((h) => !h) | ||
}, [setHidden]) | ||
|
||
return ( | ||
<span {...spanProps} onClick={onToggle}> | ||
{hidden ? '************' : props.children} | ||
</span> | ||
) | ||
} | ||
|
||
export default HidableSpan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.