Skip to content

Commit

Permalink
Merge pull request #36 from nico-i/feat/cms-update-+-better-projects
Browse files Browse the repository at this point in the history
feat: better projects and cms
  • Loading branch information
nico-i authored Jan 5, 2024
2 parents 0672698 + 6320a44 commit 30659d2
Show file tree
Hide file tree
Showing 20 changed files with 421 additions and 201 deletions.
7 changes: 4 additions & 3 deletions gatsby-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ const strapiConfig = {
},
{
singularName: `contact-link`,
queryParams: {
locale: defaultLanguage,
},
},
{
singularName: `skill`,
Expand All @@ -49,6 +46,9 @@ const strapiConfig = {
locale: `all`,
},
},
{
singularName: `project-link`,
},
],
singleTypes: [],
i18n: {
Expand All @@ -71,6 +71,7 @@ const config: GatsbyConfig = {
`gatsby-plugin-image`,
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
`gatsby-transformer-inline-svg`,
{
resolve: `gatsby-source-filesystem`,
options: {
Expand Down
3 changes: 3 additions & 0 deletions locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"help": "nutze ESC oder den X-Button zum Beenden",
"help-mobile": "nutze den X-Button zum Beenden",
"summary": "Zusammenfassung",
"tech-stack": "Technologie-Stack",
"time-frame": "Zeitrahmen",
"work-hours": "Arbeitsstunden insgesamt",
"tldr": "Kurzbeschreibung",
"read-more": "Mehr lesen",
"show-less": "Weniger anzeigen"
Expand Down
3 changes: 3 additions & 0 deletions locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"help": "use ESC or the X button to exit",
"help-mobile": "use X button to exit",
"summary": "Summary",
"tech-stack": "Tech Stack",
"time-frame": "Time Frame",
"work-hours": "Total Work Hours",
"tldr": "TL;DR",
"read-more": "Read more",
"show-less": "Show less"
Expand Down
107 changes: 107 additions & 0 deletions package-lock.json

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 @@ -35,6 +35,7 @@
"gatsby-plugin-sharp": "5.13.0",
"gatsby-source-filesystem": "5.13.0",
"gatsby-source-strapi": "3.3.1",
"gatsby-transformer-inline-svg": "1.2.0",
"gatsby-transformer-remark": "6.13.0",
"gatsby-transformer-sharp": "5.13.0",
"i18next": "23.7.13",
Expand Down
3 changes: 1 addition & 2 deletions src/components/Button/TextButton/TextButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export const TextButton = ({
className={clsx(
`underline
decoration-2
font-bold
`,
font-bold`,
className,
)}
>
Expand Down
1 change: 1 addition & 0 deletions src/components/Button/TextButton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './TextButton';
1 change: 1 addition & 0 deletions src/components/Button/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './Button';
export * from './TextButton';
32 changes: 21 additions & 11 deletions src/components/Cli/files/html/contact/contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ const ContactRun = () => {
query GetContactLinks {
allStrapiContactLink {
nodes {
icon_link {
id
text
url
svgHtml
username
url
svg {
localFile {
svg {
content
}
}
}
}
}
Expand All @@ -21,28 +24,35 @@ const ContactRun = () => {

const iconClasses = `
inline-block
text-neutral-0
mr-2
w-5
h-5
`;

const iconLinks: ContactLink[] = data.allStrapiContactLink.nodes.map(
(node: any) => node.icon_link,
const contactLinks: ContactLink[] = data.allStrapiContactLink.nodes.map(
(node: any): ContactLink => {
return {
username: node.username,
url: node.url,
svgHtml: node.svg.localFile.svg.content,
};
},
);

return (
<div className="flex flex-col justify-start gap-1">
{iconLinks.map((iconLink, i: number) => {
const { svgHtml, text, url } = iconLink;
{contactLinks.map((contactLink, i: number) => {
const { svgHtml, username, url } = contactLink;
return (
<div key={`${text}-${i}`} className="flex items-center">
<div key={`${username}-${i}`} className="flex items-center">
<span
dangerouslySetInnerHTML={{
__html: svgHtml,
}}
className={iconClasses}
/>
<Link href={url}>{text}</Link>
<Link href={url}>{username}</Link>
</div>
);
})}
Expand Down
6 changes: 2 additions & 4 deletions src/components/Cli/files/html/contact/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export const ContactLinkCollectionName = `ContactLink`;

export interface IconLink {
export interface ContactLink {
url: string;
text: string;
username: string;
svgHtml: string;
}

export interface ContactLink extends IconLink {}
Loading

0 comments on commit 30659d2

Please sign in to comment.