Skip to content

Commit

Permalink
fix : yes
Browse files Browse the repository at this point in the history
  • Loading branch information
Juknum committed Jul 17, 2024
1 parent 97393fc commit 1bdc88b
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface ContributionDraftItemProps {

export function ContributionDraftItem({ contribution, openModal, onDelete }: ContributionDraftItemProps) {
const [isPending, startTransition] = useTransition();
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const imgWidth = windowWidth <= BREAKPOINT_MOBILE_LARGE ? 60 : 90;
const author = useCurrentUser()!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function ContributionDraftModal({ contribution, textures, onClose }: Cont
const [selectedTexture, setSelectedTexture] = useState<Texture | null>(null);
const [selectedCoAuthors, setSelectedCoAuthors] = useState<PublicUser[]>(contribution.coAuthors);
const [selectedResolution, setSelectedResolution] = useState<Resolution>(contribution.resolution);
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const rowHeight = 36;
const colWidth = windowWidth <= BREAKPOINT_MOBILE_LARGE ? '100%' : 'calc((100% - (2 * var(--mantine-spacing-md))) / 3)' as const;
Expand Down
2 changes: 1 addition & 1 deletion src/app/(pages)/(protected)/contribute/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ContributionSubmittedPanel } from './submitted/submitted-panel';

const ContributePage = () => {
const [isPending, startTransition] = useTransition();
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const [resolution, setResolution] = useState<Resolution>(Resolution.x32);
const [selectedCoAuthors, setSelectedCoAuthors] = useState<PublicUser[]>([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface ContributionSubmittedItemProps {
}

export function ContributionSubmittedItem({ contribution, className, onClick }: ContributionSubmittedItemProps) {
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();
const imgWidth = windowWidth <= BREAKPOINT_MOBILE_LARGE ? 60 : 90;
const [poll, setPoll] = useState<PollResults>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface ContributionDraftPanelProps {
}

export function ContributionSubmittedPanel({ contributions, coSubmitted, onUpdate }: ContributionDraftPanelProps) {
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();
const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);
const [isPending, startTransition] = useTransition();
const [searchedContributions, setSearchedContributions] = useState<ContributionWithCoAuthorsAndPoll[]>(contributions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export interface CouncilContributionItemProps {
}

export function CouncilContributionItem({ contribution, texture, counselors, onVote }: CouncilContributionItemProps) {
const [_1, startTransition] = useTransition();
const [windowWidth, _2] = useDeviceSize();
const [, startTransition] = useTransition();
const [windowWidth] = useDeviceSize();
const counselor = useCurrentUser()!;

const imageStyle = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BREAKPOINT_MOBILE_LARGE } from '~/lib/constants';
import { ModpackModalFormValues } from './modpack-modal';

export function ModpackModalGeneral({ previewImg, modpack, form }: { form: UseFormReturnType<ModpackModalFormValues>, previewImg: string, modpack: Modpack | undefined }) {
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();
const imageWidth = windowWidth <= BREAKPOINT_MOBILE_LARGE ? windowWidth * 0.7 : 220;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface ModpackModalFormValues {
export function ModpackModal({ modpack, onClose }: { modpack?: Modpack | undefined, onClose: (editedModpack: Modpack | string) => void }) {
const [isPending, startTransition] = useTransition();
const [previewImg, setPreviewImg] = useState<string>(modpack?.image ?? '');
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const form = useForm<ModpackModalFormValues>({
initialValues: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ModpackVersions({ modpack }: { modpack: Modpack }) {
const [modalModpackVersion, setModalModpackVersion] = useState<ModpackVersionWithMods | undefined>();
const [modpackVersions, setModpackVersions] = useState<ModpackVersionWithMods[]>([]);

const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

useEffectOnce(() => {
getModpackVersions(modpack.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ModVersions({ mod }: { mod: Mod }) {
const [modVersions, setModVersions] = useState<ModVersionExtended[]>([]);
const [modalModVersion, setModalModVersion] = useState<ModVersionExtended | undefined>();

const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

useEffectOnce(() => {
getModVersionsWithModpacks(mod.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface ModModalGeneralProps {
}

export function ModModalGeneral({ previewImg, mod, form }: ModModalGeneralProps) {
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();
const imageWidth = windowWidth <= BREAKPOINT_MOBILE_LARGE ? windowWidth * 0.7 : 220;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ModModal({ mod, onClose }: {mod?: Mod | undefined, onClose: (edi
const [_mod, setMod] = useState<Mod | undefined>(mod);
const [isPending, startTransition] = useTransition();
const [previewImg, setPreviewImg] = useState<string>(mod?.image || '');
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const form = useForm<ModModalFormValues>({
initialValues: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function TextureRelations({ texture, textures }: TextureRelationsProps) {
const [relatedTextures, setRelatedTextures] = useState<Texture[]>([]);
const [newRelatedTextures, setNewRelatedTexturesIds] = useState<string[]>([]);

const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const texturePerRow = windowWidth <= BREAKPOINT_MOBILE_LARGE ? 2 : windowWidth <= BREAKPOINT_TABLET ? 4 : 6;
const parentWidth = windowWidth <= BREAKPOINT_MOBILE_LARGE
Expand Down
2 changes: 1 addition & 1 deletion src/app/(pages)/(protected)/council/textures/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { TextureModal } from './modal/texture-modal';
import './page.scss';

const CouncilTexturesPage = () => {
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();
const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);

const itemsPerPage = useMemo(() => ITEMS_PER_PAGE, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function UserReportsPanel({ user, self, reports }: { user: User, reports:
setUser(user);
}, [reports, user]);

const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

useEffectOnce(() => {
getPublicUsers()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { updateUser } from '~/server/data/user';
export function UserSettingsPanel({ user, self }: { user: User, self: boolean }) {
const { update } = useSession();
const [isPending, startTransition] = useTransition();
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const pictureWidth = windowWidth <= BREAKPOINT_MOBILE_LARGE ? `calc(${windowWidth - 2}px - (2 * var(--mantine-spacing-md)) - (2 * var(--mantine-spacing-sm)) )` : '120px';

Expand Down
2 changes: 1 addition & 1 deletion src/app/(pages)/mods/[modId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Progression } from '~/types';
export default function ModPage() {
const modId = useParams().modId as string;

const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const [mod, setMod] = useState<(Mod & { versions: ModVersion[] }) | null>(null);
const [isLoading, setLoading] = useState(true);
Expand Down
2 changes: 1 addition & 1 deletion src/app/(pages)/mods/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import '~/lib/polyfills';
type ModWithVersions = Mod & { versions: string[] };

export default function Mods() {
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

const [activePage, setActivePage] = useState(1);
const itemsPerPage = useMemo(() => ITEMS_PER_PAGE, []);
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard-item/dashboard-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface ItemDisplayProps {
}

export function DashboardItem({ image, title, description, onClick, warning }: ItemDisplayProps) {
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

return (
<Group
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface ModalProps {
}

export function Modal({ opened, onClose, title, children, popup }: ModalProps) {
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();

return (
<MantineModal
Expand Down
2 changes: 1 addition & 1 deletion src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { Tile } from './tile';
export const Navbar = () => {
const pathname = usePathname();
const user = useCurrentUser();
const [windowWidth, _] = useDeviceSize();
const [windowWidth] = useDeviceSize();
const [userPicture, setUserPicture] = useState<string | undefined>(user?.image ?? undefined);

const links = [
Expand Down

0 comments on commit 1bdc88b

Please sign in to comment.