Skip to content

Commit

Permalink
refactor the search hbs
Browse files Browse the repository at this point in the history
  • Loading branch information
nahbee10 committed Nov 7, 2024
1 parent ff2b9f3 commit 7f9aae4
Show file tree
Hide file tree
Showing 12 changed files with 3,346 additions and 555 deletions.
3,264 changes: 3,023 additions & 241 deletions assets/shared-bundle.js

Large diffs are not rendered by default.

30 changes: 26 additions & 4 deletions assets/tailwind-output.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@zendeskgarden/react-typography": "8.76.2",
"@zendeskgarden/svg-icons": "^6.34.0",
"classnames": "^2.5.1",
"date-fns": "^4.1.0",
"dompurify": "3.0.11",
"eslint-plugin-check-file": "^2.6.2",
"i18next": "^23.10.1",
Expand Down
1 change: 1 addition & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default defineConfig([
'category-page': 'src/modules/category-page/index.ts',
'section-page': 'src/modules/section-page/index.ts',
'side-nav': 'src/modules/side-nav/index.ts',
"search-result-page": "src/modules/search-result-page/index.ts",
},
output: {
dir: 'assets',
Expand Down
76 changes: 59 additions & 17 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ColoredCardsIcon } from "../svgs/Icons";
import { ColoredCardsIcon } from '../svgs/Icons';

export type Tag = {
title: string;
Expand All @@ -9,35 +9,35 @@ export type GlobalSettings = {
navigationTopics: Tag[] | null;
topNavigationApp: {
id: string;
key: string | ""; // Label of the link
value: string | ""; // URL of the link
key: string | ''; // Label of the link
value: string | ''; // URL of the link
} | null;
footerLinksTopics:
| {
id: string;
key: string | ""; // Label of the link
value: string | ""; // URL of the link
key: string | ''; // Label of the link
value: string | ''; // URL of the link
}[]
| null;
footerLinksEcosystem:
| {
id: string;
key: string | ""; // Label of the link
value: string | ""; // URL of the link
key: string | ''; // Label of the link
value: string | ''; // URL of the link
}[]
| null;
footerLinksCompany:
| {
id: string;
key: string | ""; // Label of the link
value: string | ""; // URL of the link
key: string | ''; // Label of the link
value: string | ''; // URL of the link
}[]
| null;
footerLinksHelp:
| {
id: string;
key: string | ""; // Label of the link
value: string | ""; // URL of the link
key: string | ''; // Label of the link
value: string | ''; // URL of the link
}[]
| null;
footerGithubLink: string | null;
Expand All @@ -47,14 +47,14 @@ export type GlobalSettings = {
connectBlockSupportTitle: string;
connectBlockSupportButton: {
id: string;
key: string | ""; // Label of the link
value: string | ""; // URL of the link
key: string | ''; // Label of the link
value: string | ''; // URL of the link
};
connectBlockSocialTitle: string;
connectBlockSocialButton: {
id: string;
key: string | ""; // Label of the link
value: string | ""; // URL of the link
key: string | ''; // Label of the link
value: string | ''; // URL of the link
};
connectBlockNewsletterTitle: string;
};
Expand Down Expand Up @@ -161,7 +161,7 @@ export interface Navigation {
export type Link = {
name: string;
url: string;
target?: "_blank" | "_self";
target?: '_blank' | '_self';
};

export type FooterPageData = {
Expand All @@ -183,7 +183,7 @@ export type ConnectBlock = {
newsletterTitle: string;
};

export type ColoredCardsColor = "pink" | "green" | "blue" | "orange";
export type ColoredCardsColor = 'pink' | 'green' | 'blue' | 'orange';

export type HomepageData = {
heros: {
Expand Down Expand Up @@ -253,3 +253,45 @@ export type NavState = {
section?: number;
article?: number;
};

export type SearchPageData = {
query: string;
results: SearchResult[];
typeFilters: TypeFilter[];
};

export type SearchResult = {
url: string;
title: string;
text: string;
vote_sum: number;
created_at: string;
edited_at: string | null;
comment_count: number;
meta: string;
type: string;
path_steps: {
url: string;
name: string;
target: string;
}[];
author: {
name: string;
url: string;
agent: boolean;
avatar_url: string;
signed_in: boolean;
id: number;
role: string;
};
is_external: boolean;
};

type TypeFilter = {
identifier: string;
url: string;
name: string;
selected: boolean;
label: string;
count: number;
};
Loading

0 comments on commit 7f9aae4

Please sign in to comment.