Skip to content

Commit

Permalink
chore: run prettier on whole project
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Aug 23, 2024
1 parent 1f0eb4b commit a89b4d1
Show file tree
Hide file tree
Showing 58 changed files with 206 additions and 214 deletions.
12 changes: 2 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
"plugin:storybook/recommended",
"plugin:storybook/recommended"
],
"plugins": [
"prettier",
"simple-import-sort",
"eslint-plugin-import"
],
"ignorePatterns": [
"dist",
"node_modules",
".sanity"
]
"plugins": ["prettier", "simple-import-sort", "eslint-plugin-import"],
"ignorePatterns": ["dist", "node_modules", ".sanity"]
}
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please provide a brief summary of the changes you’ve made. Explain the purpose

If applicable, please include screenshots or a short video showcasing the changes you have made.

*Insert images or videos here.*
_Insert images or videos here._

---

Expand All @@ -24,4 +24,4 @@ Please ensure that you’ve completed the following checkpoints before submittin

## Additional Notes

Other comments relevant to this pull request.
Other comments relevant to this pull request.
4 changes: 2 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
images: {
remotePatterns: [
{
protocol: "https",
Expand All @@ -13,4 +13,4 @@ const nextConfig = {
},
};

export default nextConfig;
export default nextConfig;
2 changes: 1 addition & 1 deletion src/app/(main)/legal/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function Page({ params }: Props) {
const initialDocument = await loadQuery<LegalDocument>(
LEGAL_DOCUMENT_SLUG_QUERY,
{ slug: id },
{ perspective }
{ perspective },
);

if (!initialDocument) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Home = async () => {
const { data: landingId } = await loadQuery<string>(
LANDING_QUERY,
{},
{ perspective }
{ perspective },
);

if (!landingId) {
Expand All @@ -54,7 +54,7 @@ const Home = async () => {
const initialLandingPage = await loadQuery<PageBuilder>(
PAGE_QUERY,
{ id: landingId },
{ perspective }
{ perspective },
);

if (!initialLandingPage.data) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/contactForm/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function POST(req: Request) {
{
error: "Form was not sent due to a technical error. Please try again.",
},
{ status: 500 }
{ status: 500 },
);
}
}
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 @@ -11,7 +11,7 @@ export async function GET(request: Request) {
try {
const { isValid, redirectTo = "/" } = await validatePreviewUrl(
clientWithToken,
request.url
request.url,
);

if (!isValid) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/fetchData/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function POST(req: Request) {
console.error("Error fetching data:", error);
return NextResponse.json(
{ error: "Failed to fetch data" },
{ status: 500 }
{ status: 500 },
);
}
}
4 changes: 2 additions & 2 deletions src/blog/Blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export const Blog = ({ blog, initialPosts, slug }: BlogProps) => {
const { tabListRef, selectedTabIndex } = useTabs();

const postCategories = new Set(
initialPosts.map((post) => post.category).filter((category) => category)
initialPosts.map((post) => post.category).filter((category) => category),
);

const filteredCategories = blog?.categories.filter((category) =>
postCategories.has(category.name)
postCategories.has(category.name),
);

const categories = [
Expand Down
2 changes: 1 addition & 1 deletion src/blog/BlogPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function BlogPreview({
const { data: newData } = useQuery<BlogPage | null>(
BLOG_PAGE_QUERY,
{ slug: slug, id: initialBlog.data._id },
{ initial: initialBlog }
{ initial: initialBlog },
);

const overview = newData || initialBlog.data;
Expand Down
2 changes: 1 addition & 1 deletion src/blog/components/legal/LegalPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function LegalPreview({
const { data: newDoc } = useQuery<LegalDocument | null>(
NAV_QUERY,
{},
{ initial: initialDocument }
{ initial: initialDocument },
);

return newDoc && <Legal document={newDoc} />;
Expand Down
2 changes: 1 addition & 1 deletion src/blog/components/postPreviewGrid/PostPreviewGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const PostPreviewGrid = ({
(index: number) => (el: HTMLAnchorElement | null) => {
postRefs.current[index] = el;
},
[]
[],
);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
.container {
display: flex;
gap: 1rem;
align-items: center;
}

.label {
font-size: 1rem;
color: var(--dark-purple);
}
display: flex;
gap: 1rem;
align-items: center;
}

.disabledLabel {
color: gray;
cursor: not-allowed;
}
.label {
font-size: 1rem;
color: var(--dark-purple);
}

.input {
appearance: none;
width: 24px;
height: 24px;
border: 2px solid black;
border-radius: 50%;
transition: all 0.1s ease-in-out;
box-sizing: border-box;
background-color: white;
position: relative;
}

.input:checked::after {
content: "";
position: absolute;
top: 4px;
left: 4px;
width: 12px;
height: 12px;
border-radius: 50%;
background-color: var(--primary-green-dark);
}
.disabledLabel {
color: gray;
cursor: not-allowed;
}

.input:hover {
background-color: var(--primary-green-light);
outline: 2px solid var(--primary-green-light); ;
}
.input {
appearance: none;
width: 24px;
height: 24px;
border: 2px solid black;
border-radius: 50%;
transition: all 0.1s ease-in-out;
box-sizing: border-box;
background-color: white;
position: relative;
}

.input:focus {
outline: 2px solid var(--primary-green-light);
}
.input:checked::after {
content: "";
position: absolute;
top: 4px;
left: 4px;
width: 12px;
height: 12px;
border-radius: 50%;
background-color: var(--primary-green-dark);
}

.input[disabled]{
cursor: not-allowed;
border-color: grey;
}
.input:hover {
background-color: var(--primary-green-light);
outline: 2px solid var(--primary-green-light);
}

.input:focus {
outline: 2px solid var(--primary-green-light);
}

.input[disabled] {
cursor: not-allowed;
border-color: grey;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.fieldset{
border: 0 none;
}
.fieldset {
border: 0 none;
}

.wrapper {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.wrapper {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
8 changes: 4 additions & 4 deletions src/components/navigation/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Footer = ({
legalData,
}: IFooter) => {
const renderedLogo = useConvertSanityImageToNextImage(
siteSettings.brandAssets?.secondaryLogo
siteSettings.brandAssets?.secondaryLogo,
);

const currentYear = new Date().getFullYear();
Expand Down Expand Up @@ -78,7 +78,7 @@ const renderLinks = (data: Navigation) => {
<li key={link._key}>
<CustomLink link={link} type="footerLink" />
</li>
))
)),
)
);
};
Expand All @@ -92,14 +92,14 @@ const renderSoMe = (data: Navigation, soMeData: SocialMediaProfiles) => {
<li key={link._key}>
<SoMeLink link={link} />
</li>
))
)),
)
);
};

const filterSectionsByType = (
data: Navigation,
type: "content" | "socialMedia"
type: "content" | "socialMedia",
) => data.footer?.filter((section) => section.sectionType === type);

const renderList = (children: ReactNode) => (
Expand Down
4 changes: 2 additions & 2 deletions src/components/navigation/footer/FooterPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SOMEPROFILES_QUERY } from "studio/lib/queries/socialMediaProfiles";

function useInitialData<T>(
query: string,
initialData: QueryResponseInitial<T>
initialData: QueryResponseInitial<T>,
): T | null {
const { data } = useQuery<T | null>(query, {}, { initial: initialData });
return data;
Expand All @@ -28,7 +28,7 @@ export default function FooterPreview({
const newNav = useInitialData(NAV_QUERY, initialNav);
const newSiteSettings = useInitialData(
SITESETTINGS_QUERY,
initialSiteSetting
initialSiteSetting,
);
const newSoMedata = useInitialData(SOMEPROFILES_QUERY, initialSoMe);
// TODO: add legal preview
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const Header = ({ data, assets }: IHeader) => {
export const renderPageLinks = (
links: ILink[],
isMobile: boolean,
pathname: string
pathname: string,
) => (
<ul className={isMobile ? styles.listMobile : styles.desktopLinks}>
{links?.map((link: ILink) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/navigation/header/HeaderPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export default function HeaderPreview({
const { data: newNav } = useQuery<Navigation | null>(
NAV_QUERY,
{},
{ initial: initialNav }
{ initial: initialNav },
);
const { data: newSiteSettings } = useQuery<SiteSettings | null>(
SITESETTINGS_QUERY,
{},
{ initial: initialSiteSetting }
{ initial: initialSiteSetting },
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/sections/article/Article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface ArticleProps {

const Article = ({ article }: ArticleProps) => {
const renderedImage = useConvertSanityImageToNextImage(
article?.imageExtended
article?.imageExtended,
);

return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/sections/article/ArticlePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ export default function ArticlePreview({
const { data: newData } = useQuery<PageBuilder | null>(
PAGE_QUERY,
{ id: initialData.data._id },
{ initial: initialData }
{ initial: initialData },
);

const articleSection = newData
? (newData.sections.find(
(section, index) =>
section._type === "article" && index === sectionIndex
section._type === "article" && index === sectionIndex,
) as ArticleSection)
: (initialData.data.sections.find(
(section, index) =>
section._type === "article" && index === sectionIndex
section._type === "article" && index === sectionIndex,
) as ArticleSection);

return (
Expand Down
8 changes: 4 additions & 4 deletions src/components/sections/article/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const commonLink = {
const createArticleSection = (
imageAlignment: ImageAlignment,
includeLink: boolean,
tag?: string
tag?: string,
): ArticleSection => ({
_key: "286f87152fce",
_type: "article",
Expand All @@ -65,16 +65,16 @@ const createArticleSection = (
export const extendedArticleLargeLeftMock = createArticleSection(
ImageAlignment.Left,
true,
"Measure"
"Measure",
);
export const extendedArticleLargeRightMock = createArticleSection(
ImageAlignment.Right,
true,
"Measure"
"Measure",
);

export const articleLeftMock = createArticleSection(ImageAlignment.Left, false);
export const articleRightMock = createArticleSection(
ImageAlignment.Right,
false
false,
);
Loading

0 comments on commit a89b4d1

Please sign in to comment.