Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
iwoplaza committed Dec 29, 2024
1 parent bacf794 commit a6de81e
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 120 deletions.
4 changes: 2 additions & 2 deletions apps/phoure-demo/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Provider } from 'jotai';
import { HeartIcon } from 'lucide-react';

import { SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
import { ControlsSidebar } from '@/components/ControlsSidebar';
import { Statistics } from '@/components/Statistics';
import { NavAside } from '@/components/NavAside';
import { Statistics } from '@/components/Statistics';
import { SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
import GameViewport from './GameEngine/GameViewport';
import { store } from './store';

Expand Down
10 changes: 5 additions & 5 deletions apps/phoure-demo/src/components/ControlsSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { CheckedState } from '@radix-ui/react-checkbox';
import type { SliderProps } from '@radix-ui/react-slider';
import {
type SetStateAction,
type WritableAtom,
useAtom,
useSetAtom,
} from 'jotai';
import type { RESET } from 'jotai/utils';
import { useCallback, useId } from 'react';
import type { CheckedState } from '@radix-ui/react-checkbox';
import type { SliderProps } from '@radix-ui/react-slider';
import { ChevronDown } from 'lucide-react';
import { useCallback, useId } from 'react';

import { accumulatedLayersAtom } from '@/GameEngine/sdfRenderer/sdfRenderer';
import {
Expand All @@ -26,27 +26,27 @@ import {
targetResolutionAtom,
} from '@/controlAtoms';
import { Checkbox } from './ui/checkbox';
import { Label } from './ui/label';
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from './ui/collapsible';
import { Label } from './ui/label';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from './ui/select';
import { Slider } from './ui/slider';
import {
Sidebar,
SidebarContent,
SidebarGroup,
SidebarGroupContent,
SidebarGroupLabel,
} from './ui/sidebar';
import { Slider } from './ui/slider';

function ControlLabel(props: { htmlFor: string; children: string }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/phoure-demo/src/components/NavAside.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CircleHelpIcon } from './ui/circle-help';
import { HoverCard, HoverCardContent, HoverCardTrigger } from './ui/hover-card';
import { GithubIcon } from './ui/github';
import { HoverCard, HoverCardContent, HoverCardTrigger } from './ui/hover-card';

export function NavAside() {
return (
Expand Down
4 changes: 2 additions & 2 deletions apps/phoure-demo/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
import { cva, type VariantProps } from 'class-variance-authority';
import { type VariantProps, cva } from 'class-variance-authority';
import * as React from 'react';

import { cn } from '@/lib/utils';

Expand Down
10 changes: 5 additions & 5 deletions apps/phoure-demo/src/components/ui/collapsible.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';

const Collapsible = CollapsiblePrimitive.Root
const Collapsible = CollapsiblePrimitive.Root;

const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;

const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;

export { Collapsible, CollapsibleTrigger, CollapsibleContent }
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
2 changes: 1 addition & 1 deletion apps/phoure-demo/src/components/ui/hover-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
import * as React from 'react';

import { cn } from '@/lib/utils';

Expand Down
2 changes: 1 addition & 1 deletion apps/phoure-demo/src/components/ui/separator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as SeparatorPrimitive from '@radix-ui/react-separator';
import * as React from 'react';

import { cn } from '@/lib/utils';

Expand Down
4 changes: 2 additions & 2 deletions apps/phoure-demo/src/components/ui/sheet.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client';

import * as React from 'react';
import * as SheetPrimitive from '@radix-ui/react-dialog';
import { cva, type VariantProps } from 'class-variance-authority';
import { type VariantProps, cva } from 'class-variance-authority';
import { X } from 'lucide-react';
import * as React from 'react';

import { cn } from '@/lib/utils';

Expand Down
8 changes: 4 additions & 4 deletions apps/phoure-demo/src/components/ui/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
import { type VariantProps, cva } from 'class-variance-authority';
import * as React from 'react';

import { useIsMobile } from '@/hooks/use-mobile';
import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
import { SettingsIcon } from '@/components/ui/settings';
import { Input } from '@/components/ui/input';
import { Separator } from '@/components/ui/separator';
import { SettingsIcon } from '@/components/ui/settings';
import { Sheet, SheetContent } from '@/components/ui/sheet';
import { Skeleton } from '@/components/ui/skeleton';
import {
Expand All @@ -16,6 +14,8 @@ import {
TooltipProvider,
TooltipTrigger,
} from '@/components/ui/tooltip';
import { useIsMobile } from '@/hooks/use-mobile';
import { cn } from '@/lib/utils';
import { useCallback, useMemo } from 'react';

const SIDEBAR_COOKIE_NAME = 'sidebar:state';
Expand Down
2 changes: 1 addition & 1 deletion apps/phoure-demo/src/components/ui/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
import * as React from 'react';

import { cn } from '@/lib/utils';

Expand Down
24 changes: 13 additions & 11 deletions apps/phoure-demo/src/hooks/use-mobile.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import * as React from "react"
import * as React from 'react';

const MOBILE_BREAKPOINT = 768
const MOBILE_BREAKPOINT = 768;

export function useIsMobile() {
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(
undefined,
);

React.useEffect(() => {
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
const onChange = () => {
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
}
mql.addEventListener("change", onChange)
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
return () => mql.removeEventListener("change", onChange)
}, [])
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
};
mql.addEventListener('change', onChange);
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
return () => mql.removeEventListener('change', onChange);
}, []);

return !!isMobile
return !!isMobile;
}
170 changes: 85 additions & 85 deletions apps/phoure-demo/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,91 +9,91 @@ module.exports = {
],
prefix: '',
theme: {
fontFamily: {
inter: 'Inter, sans-serif',
poppins: 'Poppins, sans-serif'
},
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px'
}
},
extend: {
colors: {
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))'
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))'
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))'
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))'
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))'
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))'
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))'
},
sidebar: {
DEFAULT: 'hsl(var(--sidebar-background))',
foreground: 'hsl(var(--sidebar-foreground))',
primary: 'hsl(var(--sidebar-primary))',
'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
accent: 'hsl(var(--sidebar-accent))',
'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
border: 'hsl(var(--sidebar-border))',
ring: 'hsl(var(--sidebar-ring))'
}
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)'
},
keyframes: {
'accordion-down': {
from: {
height: '0'
},
to: {
height: 'var(--radix-accordion-content-height)'
}
},
'accordion-up': {
from: {
height: 'var(--radix-accordion-content-height)'
},
to: {
height: '0'
}
}
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out'
}
}
fontFamily: {
inter: 'Inter, sans-serif',
poppins: 'Poppins, sans-serif',
},
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px',
},
},
extend: {
colors: {
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))',
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))',
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))',
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))',
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))',
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))',
},
sidebar: {
DEFAULT: 'hsl(var(--sidebar-background))',
foreground: 'hsl(var(--sidebar-foreground))',
primary: 'hsl(var(--sidebar-primary))',
'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
accent: 'hsl(var(--sidebar-accent))',
'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
border: 'hsl(var(--sidebar-border))',
ring: 'hsl(var(--sidebar-ring))',
},
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)',
},
keyframes: {
'accordion-down': {
from: {
height: '0',
},
to: {
height: 'var(--radix-accordion-content-height)',
},
},
'accordion-up': {
from: {
height: 'var(--radix-accordion-content-height)',
},
to: {
height: '0',
},
},
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out',
},
},
},
plugins: [require('tailwindcss-animate')],
};

0 comments on commit a6de81e

Please sign in to comment.