Skip to content

Commit

Permalink
nibble type import
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbirddev committed Oct 8, 2024
1 parent 7f91b29 commit 1741e40
Show file tree
Hide file tree
Showing 25 changed files with 39 additions and 39 deletions.
8 changes: 4 additions & 4 deletions src/@fontsensei/components/modal/commonComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, {
type ButtonHTMLAttributes, ClassAttributes,
FC,
type ButtonHTMLAttributes, type ClassAttributes,
type FC,
type InputHTMLAttributes,
type PropsWithChildren,
type ReactNode, TextareaHTMLAttributes
type ReactNode, type TextareaHTMLAttributes
} from "react";
import {useI18n} from "@fontsensei/locales";
import {Controller, type FieldError, FieldErrors, FieldValues} from "react-hook-form";
import {Controller, type FieldError, FieldErrors, type FieldValues} from "react-hook-form";
import CreatableSelect from "react-select/creatable";
import Select from "react-select";
import {RxCross1} from "react-icons/rx";
Expand Down
2 changes: 1 addition & 1 deletion src/@fontsensei/components/ssr/ClientOnly.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PropsWithChildren, useEffect, useState} from "react";
import {type PropsWithChildren, useEffect, useState} from "react";

const ClientOnly = (props: PropsWithChildren) => {
const [isClient, setClient] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {LocaleStr} from "@fontsensei/locales";
import {type LocaleStr} from "@fontsensei/locales";

const languageSpecificTags: Record<LocaleStr, string[]> = {
"en": [],
Expand Down
4 changes: 2 additions & 2 deletions src/browser/fontPicker/FontPickerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, {
forwardRef,
type CSSProperties,
memo,
PropsWithChildren
type PropsWithChildren
} from 'react';
import LandingLayout from "../../shared/ui/LandingLayout";
import {type TagValueMsgLabelType, useCurrentLocale, useI18n, useScopedI18n} from "@fontsensei/locales";
Expand All @@ -25,7 +25,7 @@ import {GoogleFontHeaders} from "../../shared/fontPicker/utils";
import {debounce, throttle} from "lodash-es";
import {cx} from "@emotion/css";
import listFonts from "@fontsensei/core/listFonts";
import {FSFontItem} from "@fontsensei/core/types";
import {type FSFontItem} from "@fontsensei/core/types";
import languageSpecificTags from "@fontsensei/data/raw/fontSensei/languageSpecificTags";

const PAGE_SIZE = 10;
Expand Down
2 changes: 1 addition & 1 deletion src/browser/i18n/SwitchLocaleHint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {PRODUCT_NAME} from "../productConstants";
import {getPreferredLocaleInBrowser, langMap, setPreferredLocaleInBrowser} from "./locales";
import useUserPreferencesStore from "../page/useUserPreferencesStore";
import {tClient} from "../../utils/api";
import {Id, toast} from "react-toastify";
import {type Id, toast} from "react-toastify";

const SwitchLocaleHint = () => {
const changeLocale = useChangeLocale();
Expand Down
2 changes: 1 addition & 1 deletion src/browser/i18n/locales.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {LocaleStr, narrowLocaleString} from "@fontsensei/locales";
import {type LocaleStr, narrowLocaleString} from "@fontsensei/locales";
import {useEffect, useState} from "react";

export const defaultLocale = {"locale": "en", "lang": "English"} as const;
Expand Down
2 changes: 1 addition & 1 deletion src/browser/landing/LandingHeading1.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {FC, PropsWithChildren} from "react";
import React, {type FC, type PropsWithChildren} from "react";
const LandingHeading1:FC<PropsWithChildren> = (props) => {
return <h1 className="text-3xl font-bold tracking-tight my-5">
{props.children}
Expand Down
2 changes: 1 addition & 1 deletion src/browser/page/useUserPreferencesStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {create} from "zustand";
import {immer} from "zustand/middleware/immer";
import {mountStoreDevtool} from "simple-zustand-devtools";
import React from "react";
import {LocaleStr} from "@fontsensei/locales";
import {type LocaleStr} from "@fontsensei/locales";
import {getPreferredLocaleInBrowser, setPreferredLocaleInBrowser} from "../i18n/locales";
interface State {
locale: LocaleStr | undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/browser/ui/HorizontalMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {PropsWithChildren, ReactElement, ReactNode, useRef} from "react";
import React, {type PropsWithChildren, ReactElement, type ReactNode, useRef} from "react";
import {ControlledMenu, MenuButton, useHover, useMenuState} from "@szhsin/react-menu";

interface Props<T,> {
Expand Down
2 changes: 1 addition & 1 deletion src/browser/ui/ModalPortal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createPortal} from "react-dom";
import {PropsWithChildren} from "react";
import {type PropsWithChildren} from "react";

const ModalPortal = (props: PropsWithChildren) => {
return createPortal(
Expand Down
2 changes: 1 addition & 1 deletion src/browser/ui/ScrollToLoadMore.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useCallback, useEffect, useRef, useState} from "react";
import listFonts from "@fontsensei/core/listFonts";
import {FSFontItem} from "@fontsensei/core/types";
import {type FSFontItem} from "@fontsensei/core/types";
const ScrollToLoadMore = ({ tagValue, initialFontItemList, PAGE_SIZE }: { tagValue: string | undefined, initialFontItemList: FSFontItem[], PAGE_SIZE: number }) => {
const [fontItemList, setFontItemList] = useState<FSFontItem[]>(initialFontItemList);
const [currentPage, setCurrentPage] = useState(0);
Expand Down
2 changes: 1 addition & 1 deletion src/browser/ui/newWindowWithLocale.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NextRouter} from "next/router";
import {type NextRouter} from "next/router";

const newWindowWithLocale = (relativePathWithoutLeadingSlash: string, router: NextRouter) => {
window.open(`/${(router.locale !== router.defaultLocale) ? (router.locale + '/') : ''}${relativePathWithoutLeadingSlash}`, "_blank");
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-restricted-imports */

import {AppProps} from "next/app";
import {type AppProps} from "next/app";

import "../styles/globals.css";
import '@szhsin/react-menu/dist/index.css';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/echo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NextApiHandler, NextApiRequest, NextApiResponse} from 'next';
import {type NextApiHandler, type NextApiRequest, type NextApiResponse} from 'next';

export const config = {
api: {
Expand Down
2 changes: 1 addition & 1 deletion src/server/api/routers/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
createTRPCRouter,
publicProcedure,
} from "../trpc";
import {zLocaleStr, allLoadedForServer, RootDictType} from "@fontsensei/locales";
import {zLocaleStr, allLoadedForServer, type RootDictType} from "@fontsensei/locales";

export const profileRouter = createTRPCRouter({
loadLocaleRootDict: publicProcedure
Expand Down
2 changes: 1 addition & 1 deletion src/server/api/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { type Session } from "next-auth";
import superjson from "superjson";
import { ZodError } from "zod";
import {env} from "../../env";
import {LocaleStr, narrowLocaleString} from "@fontsensei/locales";
import {type LocaleStr, narrowLocaleString} from "@fontsensei/locales";
import invariant from "tiny-invariant";
import {fallbackLocale} from "../../browser/i18n/locales";

Expand Down
2 changes: 1 addition & 1 deletion src/server/efetch.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Enhanced fetch

import fetch, {RequestInfo, RequestInit} from 'node-fetch';
import fetch, {RequestInfo, type RequestInit} from 'node-fetch';
import getProxy from "./getProxy";

const efetch = async (url: string, init?: RequestInit, options?: { doNotRejectByStatusCode?: boolean }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/shared/getStaticPropsLocale.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {allLoadedForServer, LocaleStr, narrowLocaleString} from "@fontsensei/locales";
import {BaseLocale, flattenLocale} from "next-international";
import {GetStaticProps} from "next";
import {type BaseLocale, flattenLocale} from "next-international";
import {type GetStaticProps} from "next";

export const getLocaleContent = async (localeStr: string | undefined) => {
const localeKey = narrowLocaleString(localeStr) ?? "en";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/H2Section.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {PropsWithChildren, ReactNode} from "react";
import React, {type PropsWithChildren, type ReactNode} from "react";
import MDX from "@mdx-js/runtime";
import Link from "next/link";

Expand Down
6 changes: 3 additions & 3 deletions src/shared/user/session.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {SessionContextValue, useSession} from "next-auth/react";
import React, {FC, PropsWithChildren, useContext} from "react";
import {Session, } from "next-auth";
import {type SessionContextValue, useSession} from "next-auth/react";
import React, {type FC, type PropsWithChildren, useContext} from "react";
import {type Session, } from "next-auth";

export type SessionLoadedContextValue = (
{ update: SessionContextValue['update']; data: Session; status: "authenticated" }
Expand Down
2 changes: 1 addition & 1 deletion src/slidde-ui/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import {ReactNode, useState} from "react";
import {type ReactNode, useState} from "react";

const Tabs = <T extends string, >(props: {
initialActiveKey: T,
Expand Down
10 changes: 5 additions & 5 deletions src/slidde-ui/form.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, {
ButtonHTMLAttributes, HTMLAttributes,
InputHTMLAttributes,
LabelHTMLAttributes,
PropsWithChildren,
TextareaHTMLAttributes
type ButtonHTMLAttributes, type HTMLAttributes,
type InputHTMLAttributes,
type LabelHTMLAttributes,
type PropsWithChildren,
type TextareaHTMLAttributes
} from "react";

type ButtonProps = PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> & {extraClassnames?: string};
Expand Down
8 changes: 4 additions & 4 deletions src/slidde-ui/modal/commonComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, {
type ButtonHTMLAttributes, ClassAttributes,
FC,
type ButtonHTMLAttributes, type ClassAttributes,
type FC,
type InputHTMLAttributes,
type PropsWithChildren,
type ReactNode, TextareaHTMLAttributes
type ReactNode, type TextareaHTMLAttributes
} from "react";
import {useI18n} from "@fontsensei/locales";
import {Controller, type FieldError, FieldErrors, FieldValues} from "react-hook-form";
import {Controller, type FieldError, FieldErrors, type FieldValues} from "react-hook-form";
import CreatableSelect from "react-select/creatable";
import Select from "react-select";
import {RxCross1} from "react-icons/rx";
Expand Down
2 changes: 1 addition & 1 deletion src/slidde-ui/ssr/ClientOnly.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PropsWithChildren, useEffect, useState} from "react";
import {type PropsWithChildren, useEffect, useState} from "react";

const ClientOnly = (props: PropsWithChildren) => {
const [isClient, setClient] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/slidde-ui/useModalStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ReactNode} from "react";
import {type ReactNode} from "react";
import {create} from "zustand";
import {immer} from "zustand/middleware/immer";
import {mountStoreDevtool} from "simple-zustand-devtools";
Expand Down

0 comments on commit 1741e40

Please sign in to comment.