Skip to content

Commit

Permalink
Merge pull request #564 from VitNode/feat/error_icons
Browse files Browse the repository at this point in the history
feat(frontend): Add different icons based on error code in error view
  • Loading branch information
aXenDeveloper authored Oct 20, 2024
2 parents deb6a2e + 5c0a8fb commit 103274a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ jobs:
- name: Build Projects
run: pnpm run build --filter=vitnode-backend --filter=vitnode-frontend --filter=vitnode-backend-email-resend --filter=vitnode-backend-email-smtp --filter=vitnode-backend-ai-google --filter=vitnode-backend-ai-open-ai

- name: Run script to bump version
if: github.event.inputs.skip_bump_version == false
- name: Run script to bump version & copy files
if: github.event.inputs.skip_bump_version == 'false'
run: pnpm run release
id: version-bump
env:
VERSION_TYPE: ${{ github.event.inputs.type }}
RELEASE_TYPE: ${{ github.event.inputs.release }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run script to bump version
if: github.event.inputs.skip_bump_version == true
- name: Run script to only copy files
if: github.event.inputs.skip_bump_version == 'true'
run: pnpm run release --without-bump-version
id: version-bump-without-bump-version
env:
Expand All @@ -75,13 +75,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Pre-release
if: github.event.inputs.release == 'canary' || github.event.inputs.release == 'release-candidate' && github.event.inputs.skip_bump_version == false
if: github.event.inputs.release == 'canary' || github.event.inputs.release == 'release-candidate' && github.event.inputs.skip_bump_version == 'false'
run: gh release create ${{ steps.version-bump.outputs.newTag }} --generate-notes --prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: github.event.inputs.release == 'stable' && github.event.inputs.skip_bump_version == false
if: github.event.inputs.release == 'stable' && github.event.inputs.skip_bump_version == 'false'
run: gh release create ${{ steps.version-bump.outputs.newTag }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default [
},
{
rules: {
'perfectionist/sort-switch-case': 'warn',
'@typescript-eslint/no-unnecessary-condition': 'off',
'perfectionist/sort-named-exports': 'warn',
'perfectionist/sort-enums': 'warn',
Expand Down
13 changes: 11 additions & 2 deletions packages/frontend/src/views/theme/views/error/error-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@/components/ui/card';
import { cn } from '@/helpers/classnames';
import { Link } from '@/navigation';
import { AlertTriangle, Home } from 'lucide-react';
import { AlertTriangle, Home, SearchX, ShieldX } from 'lucide-react';
import { useTranslations } from 'next-intl';

export interface ErrorViewProps {
Expand All @@ -24,7 +24,16 @@ export const ErrorView = ({ className, code }: ErrorViewProps) => {
<div className={cn('mx-auto my-10 max-w-2xl px-4', className)}>
<Card>
<CardHeader className="items-center pb-2">
<AlertTriangle className="size-16" />
{(() => {
switch (code) {
case '403':
return <ShieldX className="size-16" />;
case '404':
return <SearchX className="size-16" />;
default:
return <AlertTriangle className="size-16" />;
}
})()}
</CardHeader>
<CardContent className="flex flex-col items-center pb-4 text-center">
<span className="text-muted-foreground">{t('title')}</span>
Expand Down

0 comments on commit 103274a

Please sign in to comment.