Skip to content

Commit

Permalink
chore: npm run fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Sep 17, 2024
1 parent 331c39f commit 8817d7c
Show file tree
Hide file tree
Showing 176 changed files with 609 additions and 415 deletions.
3 changes: 2 additions & 1 deletion sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*/

import { defineConfig } from "sanity";
import sharedStudioConfig from "./studioShared/studioConfig";

import studioConfig from "./studio/studioConfig";
import sharedStudioConfig from "./studioShared/studioConfig";

export default defineConfig([studioConfig, sharedStudioConfig]);
1 change: 1 addition & 0 deletions src/app/(main)/[slug]/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { loadQuery } from "@sanity/react-loader";
import { Metadata } from "next";

import PostPage from "src/post/PostPage";
import PostPagePreview from "src/post/PostPagePreview";
import { getDraftModeInfo } from "src/utils/draftmode";
Expand Down
15 changes: 8 additions & 7 deletions src/app/(main)/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { Metadata } from "next";

import { Blog } from "src/blog/Blog";
import BlogPreview from "src/blog/BlogPreview";
import CustomErrorMessage from "src/blog/components/customErrorMessage/CustomErrorMessage";
import { homeLink } from "src/blog/components/utils/linkTypes";
import Compensations from "src/compensations/Compensations";
import CompensationsPreview from "src/compensations/CompensationsPreview";
import { getDraftModeInfo } from "src/utils/draftmode";
import SectionRenderer from "src/utils/renderSection";
import { fetchSeoData, generateMetadataFromSeo } from "src/utils/seo";
import { BlogPage, PageBuilder, Post } from "studio/lib/interfaces/pages";
import { CompanyLocation } from "studio/lib/interfaces/companyDetails";
import { CompensationsPage } from "studio/lib/interfaces/compensations";
import { BlogPage, PageBuilder, Post } from "studio/lib/interfaces/pages";
import { COMPANY_LOCATIONS_QUERY } from "studio/lib/queries/companyDetails";
import {
BLOG_PAGE_QUERY,
POSTS_QUERY,
COMPENSATIONS_PAGE_QUERY,
POSTS_QUERY,
SEO_SLUG_QUERY,
SLUG_QUERY,
} from "studio/lib/queries/pages";
import { loadQuery } from "studio/lib/store";
import CompensationsPreview from "src/compensations/CompensationsPreview";
import { homeLink } from "../../../blog/components/utils/linkTypes";
import CustomErrorMessage from "../../../blog/components/customErrorMessage/CustomErrorMessage";
import { CompanyLocation } from "studio/lib/interfaces/companyDetails";
import { COMPANY_LOCATIONS_QUERY } from "studio/lib/queries/companyDetails";

export const dynamic = "force-dynamic";

Expand Down
25 changes: 13 additions & 12 deletions src/app/(main)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import Footer from "src/components/navigation/footer/Footer";
import { NAV_QUERY } from "studio/lib/queries/navigation";
import { COMPANY_INFO_QUERY } from "studio/lib/queries/companyDetails";
import FooterPreview from "src/components/navigation/footer/FooterPreview";
import { Header } from "src/components/navigation/header/Header";
import { Navigation } from "studio/lib/interfaces/navigation";
import { CompanyInfo } from "studio/lib/interfaces/companyDetails";
import { loadQuery } from "studio/lib/store";
import HeaderPreview from "src/components/navigation/header/HeaderPreview";
import FooterPreview from "src/components/navigation/footer/FooterPreview";
import { SOMEPROFILES_QUERY } from "studio/lib/queries/socialMediaProfiles";
import { SocialMediaProfiles } from "studio/lib/interfaces/socialMedia";
import { getDraftModeInfo } from "src/utils/draftmode";
import SkipToMain from "src/components/skipToMain/SkipToMain";
import { LEGAL_DOCUMENTS_QUERY } from "studio/lib/queries/legalDocuments";
import { getDraftModeInfo } from "src/utils/draftmode";
import { BrandAssets } from "studio/lib/interfaces/brandAssets";
import { CompanyInfo } from "studio/lib/interfaces/companyDetails";
import { LegalDocument } from "studio/lib/interfaces/legalDocuments";
import { Navigation } from "studio/lib/interfaces/navigation";
import { SocialMediaProfiles } from "studio/lib/interfaces/socialMedia";
import { BRAND_ASSETS_QUERY } from "studio/lib/queries/brandAssets";
import { COMPANY_INFO_QUERY } from "studio/lib/queries/companyDetails";
import { LEGAL_DOCUMENTS_QUERY } from "studio/lib/queries/legalDocuments";
import { NAV_QUERY } from "studio/lib/queries/navigation";
import { SOMEPROFILES_QUERY } from "studio/lib/queries/socialMediaProfiles";
import { loadQuery } from "studio/lib/store";

import styles from "./layout.module.css";
import { BRAND_ASSETS_QUERY } from "../../../studio/lib/queries/brandAssets";
import { BrandAssets } from "../../../studio/lib/interfaces/brandAssets";

const hasValidData = (data: any) => data && Object.keys(data).length > 0;

Expand Down
13 changes: 7 additions & 6 deletions src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Metadata } from "next";

import InformationSection from "src/blog/components/informationSection/InformationSection";
import { getDraftModeInfo } from "src/utils/draftmode";
import { LANDING_QUERY } from "studio/lib/queries/navigation";
import { PAGE_QUERY, SEO_PAGE_QUERY } from "studio/lib/queries/pages";
import { PageBuilder } from "studio/lib/interfaces/pages";
import SectionRenderer from "src/utils/renderSection";
import { loadQuery } from "studio/lib/store";
import { Metadata } from "next";
import { fetchSeoData, generateMetadataFromSeo } from "src/utils/seo";
import InformationSection from "src/blog/components/informationSection/InformationSection";
import { LinkType } from "studio/lib/interfaces/navigation";
import { PageBuilder } from "studio/lib/interfaces/pages";
import { LANDING_QUERY } from "studio/lib/queries/navigation";
import { PAGE_QUERY, SEO_PAGE_QUERY } from "studio/lib/queries/pages";
import { loadQuery } from "studio/lib/store";

export async function generateMetadata(): Promise<Metadata> {
const { data: landingId } = await loadQuery<string>(LANDING_QUERY);
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/contactForm/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { PubSub } from "@google-cloud/pubsub";
import { NextResponse } from "next/server";

export interface ContactData {
name: string;
Expand Down
1 change: 1 addition & 0 deletions src/app/api/disable-draft/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { draftMode } from "next/headers";
import { NextRequest, NextResponse } from "next/server";

import { absoluteUrlFromNextRequest } from "src/utils/url";

export function GET(request: NextRequest) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/draft/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { validatePreviewUrl } from "@sanity/preview-url-secret";
import { draftMode } from "next/headers";
import { NextRequest, NextResponse } from "next/server";

import { absoluteUrlFromNextRequest } from "src/utils/url";
import { client } from "studio/lib/client";
import { token } from "studio/lib/token";
import { absoluteUrlFromNextRequest } from "src/utils/url";

const clientWithToken = client.withConfig({ token });

Expand Down
1 change: 1 addition & 0 deletions src/app/api/fetchData/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NextResponse } from "next/server";

import { client } from "studio/lib/client";
import { token } from "studio/lib/token";

Expand Down
4 changes: 3 additions & 1 deletion src/app/api/openGraphImage/route.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { ImageResponse } from "next/og";
import { NextRequest } from "next/server";

import { OPEN_GRAPH_IMAGE_DIMENSIONS } from "src/utils/seo";

import OpenGraphImage from "./OpenGraphImage";
import { OPEN_GRAPH_IMAGE_DIMENSIONS } from "../../../utils/seo";

export async function GET(request: NextRequest) {
const searchParams = request.nextUrl.searchParams;
Expand Down
5 changes: 3 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Metadata } from "next";
import { Darker_Grotesque, Figtree } from "next/font/google";
import { draftMode } from "next/headers";

import LiveVisualEditing from "studio/lib/loaders/AutomaticVisualEditing";
import { Metadata } from "next";
import { loadQuery } from "studio/lib/store";
import "src/styles/global.css";
import { generateMetadataFromSeo } from "src/utils/seo";
import { DEFAULT_LANGUAGE_QUERY } from "../../studio/lib/queries/languages";
import { DEFAULT_LANGUAGE_QUERY } from "studio/lib/queries/languages";

const darkerGrotesque = Darker_Grotesque({
subsets: ["latin"],
Expand Down
7 changes: 4 additions & 3 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { MetadataRoute } from "next";
import { client } from "../../studio/lib/client";
import { Slug } from "../../studio/lib/interfaces/global";
import { token } from "../../studio/lib/token";

import { client } from "studio/lib/client";
import { Slug } from "studio/lib/interfaces/global";
import { token } from "studio/lib/token";

interface SitemapDocument {
slug: Slug;
Expand Down
12 changes: 7 additions & 5 deletions src/blog/Blog.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
"use client";
import { useEffect, useCallback } from "react";
import { useCallback, useEffect } from "react";

import PostPreview from "src/blog/components/postPreview/PostPreview";
import { useFetchPosts } from "src/utils/hooks/useFetchPosts";
import useTabs from "src/utils/hooks/useTabs";
import { BlogPage, Post } from "studio/lib/interfaces/pages";

import styles from "./blog.module.css";
import { useFetchPosts } from "src/utils/hooks/useFetchPosts";
import CustomErrorMessage from "./components/customErrorMessage/CustomErrorMessage";
import BlogHero from "./components/hero/BlogHero";
import PostPreview from "src/blog/components/postPreview/PostPreview";
import PostPreviewGrid from "./components/postPreviewGrid/PostPreviewGrid";
import LoadingNews from "./components/loadingNews/LoadingNews";
import CustomErrorMessage from "./components/customErrorMessage/CustomErrorMessage";
import PostPreviewGrid from "./components/postPreviewGrid/PostPreviewGrid";
import { homeLink } from "./components/utils/linkTypes";

interface BlogProps {
Expand Down
4 changes: 3 additions & 1 deletion src/blog/BlogPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"use client";
import { QueryResponseInitial, useQuery } from "@sanity/react-loader";
import { Suspense } from "react";

import { BlogPage, Post } from "studio/lib/interfaces/pages";
import { BLOG_PAGE_QUERY } from "studio/lib/queries/pages";
import { Suspense } from "react";

import { Blog } from "./Blog";

interface BlogPreviewProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Button from "src/components/buttons/Button";
import LinkButton from "src/components/linkButton/LinkButton";
import Text from "src/components/text/Text";
import { ILink } from "studio/lib/interfaces/navigation";

import styles from "./customErrorMessage.module.css";

interface CustomErrorMessageProps {
Expand Down
1 change: 1 addition & 0 deletions src/blog/components/hero/BlogHero.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meta, StoryObj } from "@storybook/react";

import BlogHero from "./BlogHero";

const meta: Meta<typeof BlogHero> = {
Expand Down
6 changes: 4 additions & 2 deletions src/blog/components/hero/BlogHero.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { LegacyRef } from "react";

import Text from "src/components/text/Text";
import styles from "./blogHero.module.css";
import { Category } from "studio/lib/interfaces/pages";
import { LegacyRef } from "react";

import styles from "./blogHero.module.css";

const BlogHero = ({
title,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from "react";

import LinkButton from "src/components/linkButton/LinkButton";
import Text from "src/components/text/Text";
import { ILink } from "studio/lib/interfaces/navigation";

import styles from "./informationSection.module.css";
import React from "react";

interface InformationSectionProps {
title: string;
Expand Down
8 changes: 5 additions & 3 deletions src/blog/components/legal/Legal.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import Link from "next/link";

import { PortableTextBlock, RichText } from "src/components/richText/RichText";
import Text from "src/components/text/Text";
import styles from "./legal.module.css";
import { LegalDocument } from "studio/lib/interfaces/legalDocuments";
import { RichText, PortableTextBlock } from "src/components/richText/RichText";
import Link from "next/link";

import styles from "./legal.module.css";

const extractHeadings = (blocks: PortableTextBlock[]) => {
return blocks
Expand Down
4 changes: 3 additions & 1 deletion src/blog/components/legal/LegalPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"use client";
import { QueryResponseInitial, useQuery } from "@sanity/react-loader";
import { NAV_QUERY } from "studio/lib/queries/navigation";

import { LegalDocument } from "studio/lib/interfaces/legalDocuments";
import { NAV_QUERY } from "studio/lib/queries/navigation";

import Legal from "./Legal";

export default function LegalPreview({
Expand Down
1 change: 1 addition & 0 deletions src/blog/components/loadingNews/LoadingNews.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Text from "src/components/text/Text";

import styles from "./loadingNews.module.css";

const LoadingNews = () => {
Expand Down
1 change: 1 addition & 0 deletions src/blog/components/postCard/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Text from "src/components/text/Text";
import { useConvertSanityImageToNextImage } from "src/utils/hooks/useConvertImage";
import { Post } from "studio/lib/interfaces/pages";

import styles from "./postCard.module.css";

export const PostCard = ({
Expand Down
9 changes: 5 additions & 4 deletions src/blog/components/postPreview/PostPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use client";
import { RichText, PortableTextBlock } from "src/components/richText/RichText";
import CustomLink from "src/components/link/CustomLink";
import { PortableTextBlock, RichText } from "src/components/richText/RichText";
import Text from "src/components/text/Text";
import { useConvertSanityImageToNextImage } from "src/utils/hooks/useConvertImage";
import { LinkType } from "studio/lib/interfaces/navigation";
import { Post } from "studio/lib/interfaces/pages";

import styles from "./postPreview.module.css";
import CustomLink from "src/components/link/CustomLink";
import { LinkType } from "studio/lib/interfaces/navigation";
import { useConvertSanityImageToNextImage } from "src/utils/hooks/useConvertImage";

export interface PostPreviewProps {
post: Post;
Expand Down
3 changes: 2 additions & 1 deletion src/blog/components/postPreview/PostReview.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Meta, StoryObj } from "@storybook/react";
import PostPreview from "./PostPreview";

import { postMock } from "./mockData";
import PostPreview from "./PostPreview";

const meta: Meta<typeof PostPreview> = {
title: "Blog/PostPreview",
Expand Down
2 changes: 1 addition & 1 deletion src/blog/components/postPreview/mockData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import placeholder from "src/stories/assets/image-placeholder.png";
import { PortableTextBlock } from "src/components/richText/RichText";
import placeholder from "src/stories/assets/image-placeholder.png";

// Common rich text for lead and main content
const leadRichText: PortableTextBlock[] = [
Expand Down
8 changes: 5 additions & 3 deletions src/blog/components/postPreviewGrid/PostPreviewGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, { useEffect, useRef, useState, useCallback } from "react";
import React, { useCallback, useEffect, useRef, useState } from "react";

import { PostCard } from "src/blog/components/postCard/PostCard";
import Button from "src/components/buttons/Button";
import Text from "src/components/text/Text";
import { Post } from "studio/lib/interfaces/pages";

import styles from "./postPreviewGrid.module.css";
import Button from "src/components/buttons/Button";
import { PostCard } from "../postCard/PostCard";

const PostPreviewGrid = ({
posts,
Expand Down
20 changes: 11 additions & 9 deletions src/compensations/Compensations.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
"use client";
import styles from "./compensations.module.css";
import { useMemo, useState } from "react";

import {
IOption,
RadioButtonGroup,
} from "src/components/forms/radioButtonGroup/RadioButtonGroup";
import Text from "src/components/text/Text";
import { CompanyLocation } from "studio/lib/interfaces/companyDetails";
import { CompensationsPage } from "studio/lib/interfaces/compensations";

import styles from "./compensations.module.css";
import BenefitsByLocation from "./components/benefitsByLocation/BenefitsByLocation";
import SalaryCalculator, {
Degree,
} from "./components/salaryCalculator/SalaryCalculator";
import { useMemo, useState } from "react";
import YearlyBonuses from "./components/yearlyBonuses/YearlyBonuses";
import {
calculatePension,
calculateSalary,
maxSalariesExaminationYear,
minSalariesExaminationYear,
salariesFromLocation,
} from "./utils/salary";
import { CompanyLocation } from "studio/lib/interfaces/companyDetails";
import {
IOption,
RadioButtonGroup,
} from "src/components/forms/radioButtonGroup/RadioButtonGroup";
import YearlyBonuses from "./components/yearlyBonuses/YearlyBonuses";
import BenefitsByLocation from "./components/benefitsByLocation/BenefitsByLocation";

interface CompensationsProps {
compensations: CompensationsPage;
Expand Down
8 changes: 5 additions & 3 deletions src/compensations/CompensationsPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"use client";
import { Suspense } from "react";
import Compensations from "./Compensations";
import { QueryResponseInitial, useQuery } from "@sanity/react-loader";
import { CompensationsPage } from "studio/lib/interfaces/compensations";
import { Suspense } from "react";

import { CompanyLocation } from "studio/lib/interfaces/companyDetails";
import { CompensationsPage } from "studio/lib/interfaces/compensations";
import { COMPANY_LOCATIONS_QUERY } from "studio/lib/queries/companyDetails";
import { COMPENSATIONS_PAGE_QUERY } from "studio/lib/queries/pages";

import Compensations from "./Compensations";

interface CompensationsPreviewProps {
initialCompensations: QueryResponseInitial<CompensationsPage>;
initialLocations: QueryResponseInitial<CompanyLocation[]>;
Expand Down
Loading

0 comments on commit 8817d7c

Please sign in to comment.