-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(v2): add about page * fix app icon when app is built * fix typo in label
- Loading branch information
Showing
8 changed files
with
92 additions
and
2 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
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,22 @@ | ||
import React from 'react'; | ||
|
||
type ExternalLinkProps = { | ||
href: string; | ||
} & React.AnchorHTMLAttributes<HTMLAnchorElement>; | ||
|
||
export const ExternalLink = React.forwardRef<HTMLAnchorElement, ExternalLinkProps>( | ||
({ children, href, ...otherProps }, ref) => { | ||
const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => { | ||
event.preventDefault(); | ||
window.electron.openExternalLink(href); | ||
}; | ||
|
||
return ( | ||
<a href={href} ref={ref} {...otherProps} onClick={handleClick}> | ||
{children} | ||
</a> | ||
); | ||
}, | ||
); | ||
|
||
ExternalLink.displayName = 'ExternalLink'; |
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
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,3 @@ | ||
export const APP_WEBSITE_URL = 'https://murgatt.github.io/recode-converter/'; | ||
export const AUTHOR_GITHUB_URL = 'https://github.com/murgatt/'; | ||
export const GITHUB_REPOSITORY_URL = 'https://github.com/murgatt/recode-converter'; |
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
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
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
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,43 @@ | ||
import { GithubIcon, LinkIcon } from 'lucide-react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { ExternalLink } from 'src/components/ExternalLink'; | ||
import { Button } from 'src/components/ui/Button'; | ||
import { Tooltip } from 'src/components/ui/Tooltip'; | ||
import { APP_WEBSITE_URL, AUTHOR_GITHUB_URL, GITHUB_REPOSITORY_URL } from 'src/constants'; | ||
import { version } from '../../package.json'; | ||
|
||
export const About = () => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<section className="flex h-screen flex-col items-center overflow-y-auto p-6"> | ||
<img alt={t('about.appIconAlt')} className="w-48 max-w-full" src="./icon.png" /> | ||
<div className="flex w-full flex-col items-center gap-3"> | ||
<h1 className="title-lg w-full text-center">Recode Converter</h1> | ||
<p className="caption-sm">v{version}</p> | ||
<p className="paragraph-sm"> | ||
{t('about.developedBy')}{' '} | ||
<ExternalLink className="underline underline-offset-4" href={AUTHOR_GITHUB_URL}> | ||
@murgatt | ||
</ExternalLink> | ||
</p> | ||
<div className="flex gap-1"> | ||
<Tooltip content={t('about.githubLabel')} position="bottom"> | ||
<Button aria-label={t('about.githubLabel')} asChild size="icon" variant="ghost"> | ||
<ExternalLink href={GITHUB_REPOSITORY_URL}> | ||
<GithubIcon size="16" /> | ||
</ExternalLink> | ||
</Button> | ||
</Tooltip> | ||
<Tooltip content={t('about.websiteLabel')} position="bottom"> | ||
<Button aria-label={t('about.websiteLabel')} asChild size="icon" variant="ghost"> | ||
<ExternalLink href={APP_WEBSITE_URL}> | ||
<LinkIcon size="16" /> | ||
</ExternalLink> | ||
</Button> | ||
</Tooltip> | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
}; |