Skip to content

Commit

Permalink
feat(ui-patterns): add footer & hero pattern (#1310)
Browse files Browse the repository at this point in the history
* feat: add hero section pattern draft WIP

* refactor: classNames

* feat: create footer pattern

* refactor: add dashed outline to patterns instead

* refactor: deploy ui-patterns

* feat: add footer & hero pattern to landingpage
  • Loading branch information
TobiasHeimGalindo authored Mar 12, 2024
1 parent 85031e9 commit bcfc216
Show file tree
Hide file tree
Showing 15 changed files with 409 additions and 8 deletions.
Binary file added assets/elements-preview-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions packages/elements/src/global/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

.inovex-elements-typo {
font-family: Lato, Verdana, sans-serif;

a {
a:not(.tailwind) {
background-color: transparent;
color: new-theme.$primary;
font-weight: bold;
Expand Down
18 changes: 17 additions & 1 deletion packages/landingpage/app/[lang]/library/patterns/client.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { NextPage } from 'next';
import { Login, SettingsPage } from '@inovex.de/ui-patterns';
import { Login, Footer, Hero, SettingsPage } from '@inovex.de/ui-patterns';
import PreviewBox from './_components/preview-box';
import styles from './client.module.scss';
import { useTranslation } from '@hooks/useTranslation';
Expand Down Expand Up @@ -39,6 +39,22 @@ export const PatternsPage: NextPage<PatternsPageProps> = ({
highlightedCode={highlightedCodes.login}
rawCode={codeStrings.login}
/>
<PreviewBox
title={t('library.designPatterns.hero.title')}
id="hero"
description={t('library.designPatterns.hero.description')}
previewComponent={<Hero />}
highlightedCode={highlightedCodes.hero}
rawCode={codeStrings.hero}
/>
<PreviewBox
title={t('library.designPatterns.footer.title')}
id="footer"
description={t('library.designPatterns.footer.description')}
previewComponent={<Footer />}
highlightedCode={highlightedCodes.footer}
rawCode={codeStrings.footer}
/>
<PreviewBox
title={t('library.designPatterns.settingsPage.title')}
id="settingsPage"
Expand Down
4 changes: 2 additions & 2 deletions packages/landingpage/app/[lang]/library/patterns/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getMetaTitle } from 'utils/getMetaTitle';
import { translator } from 'translations/getTranslations';
import { HighlightedCodes, PatternsPage } from './client';
import { getHighlighter } from 'shiki';
import { login, settingsPage } from '@inovex.de/ui-patterns/html';
import { login, settingsPage, footer, hero } from '@inovex.de/ui-patterns/html';

export async function generateMetadata({ params }: WithLangParam) {
const title = await translator('common.meta.library', params.lang);
Expand All @@ -13,7 +13,7 @@ export async function generateMetadata({ params }: WithLangParam) {
}

export default async function Page() {
const codeStrings = { login, settingsPage };
const codeStrings = { login, settingsPage, footer, hero };

const highlighter = await getHighlighter({ theme: 'github-dark-dimmed' });
const codeToHtml = (code: string) =>
Expand Down
8 changes: 8 additions & 0 deletions packages/landingpage/translations/locales/de/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"settingsPage": {
"title": "Einstellungsseite",
"description": "Bieten Sie eine übersichtliche und anpassbare Einstellungsoberfläche, die es Benutzern ermöglicht, ihre Präferenzen einfach zu verwalten."
},
"hero": {
"title": "Hero-Bereich",
"description": "Schaffen Sie einen fesselnden ersten Eindruck mit einem Hero-Bereich, der ästhetische Anziehungskraft mit klarer Botschaft verbindet."
},
"footer": {
"title": "Footer-Navigation",
"description": "Runden Sie Ihre Webseite mit einem Footer ab, der wesentliche Informationen und Navigationshinweise in einem prägnanten Layout bietet."
}
}
}
10 changes: 9 additions & 1 deletion packages/landingpage/translations/locales/en/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"header": {
"top": "Efficient Development",
"title": "Design Patterns",
"subtitle": "Elevate your project with our lovingly crafted design patterns, optimized for web development. The inovex Elements web components, seamlessly integrated with Tailwind CSS, empowers you to build responsive and visually appealing user interfaces with ease. Our commitment to quality ensures each pattern is meticulously designed for modern web applications."
"subtitle": "Elevate your project with our lovingly crafted design patterns, optimized for web development. The inovex Elements web components, seamlessly integrated with Tailwind CSS, empower you to build responsive and visually appealing user interfaces with ease. Our commitment to quality ensures each pattern is meticulously designed for modern web applications."
},
"login": {
"title": "Login",
Expand All @@ -12,6 +12,14 @@
"settingsPage": {
"title": "Settings Page",
"description": "Offer an efficient and customizable settings experience, ensuring user preferences are easily accessible and manageable."
},
"hero": {
"title": "Hero Section",
"description": "Craft a captivating first impression with a Hero Section that combines aesthetic appeal and clear messaging."
},
"footer": {
"title": "Footer Navigation",
"description": "Conclude your site with a Footer that provides essential information and navigational cues in a concise layout."
}
}
}
12 changes: 10 additions & 2 deletions packages/ui-patterns-playground/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { MyPatternA, Login, SettingsPage } from '@inovex.de/ui-patterns';
import {
MyPatternA,
Login,
SettingsPage,
Footer,
Hero,
} from '@inovex.de/ui-patterns';
import '@inovex.de/elements-react';

import Guide from './components/guide';
Expand All @@ -11,9 +17,11 @@ function App() {
<NavigationDrawer>
<Routes>
<Route path="/" element={<Login />} />
<Route path="/mypatterna" element={<MyPatternA />} />
<Route path="/hero" element={<Hero />} />
<Route path="/footer" element={<Footer />} />
<Route path="/guide" element={<Guide />} />
<Route path="/settings" element={<SettingsPage />} />
<Route path="/mypatterna" element={<MyPatternA />} />
</Routes>
</NavigationDrawer>
</Router>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ function NavigationDrawer({ children }: NavigationDrawerProps) {
<InoIcon icon="number"></InoIcon>
</InoNavItem>
</Link>
<Link to="/hero">
<InoNavItem role="menuitem" text="Hero">
<InoIcon icon="display"></InoIcon>
</InoNavItem>
</Link>
<Link to="/footer">
<InoNavItem role="menuitem" text="Footer">
<InoIcon icon="display"></InoIcon>
</InoNavItem>
</Link>
</InoList>

<InoList role="menubar" slot="footer" aria-label="Footer Navigation">
Expand Down
100 changes: 100 additions & 0 deletions packages/ui-patterns/assets/inovex-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/ui-patterns/src/html.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { default as myPatternA } from './patterns/my-pattern-a/my-pattern-a.html?raw';
export { default as login } from './patterns/login/login.html?raw';
export { default as settingsPage } from './patterns/settingsPage/settingsPage.html?raw';
export { default as hero } from './patterns/hero/hero.html?raw';
export { default as footer } from './patterns/footer/footer.html?raw';
6 changes: 6 additions & 0 deletions packages/ui-patterns/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ export { default as myPatternAHtml } from './patterns/my-pattern-a/my-pattern-a.
export { default as Login } from './patterns/login/Login';
export { default as loginHtml } from './patterns/login/login.html?raw';

export { default as Footer } from './patterns/footer/Footer';
export { default as footerHtml } from './patterns/footer/footer.html?raw';

export { default as Hero } from './patterns/hero/Hero';
export { default as heroHtml } from './patterns/hero/hero.html?raw';

export { default as SettingsPage } from './patterns/settingsPage/SettingsPage';
export { default as settingsPageHtml } from './patterns/settingsPage/settingsPage.html?raw';
18 changes: 18 additions & 0 deletions packages/ui-patterns/src/patterns/footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { useEffect } from 'react';
import htmlContent from './footer.html?raw';
import PatternWrapper from '../PatternWrapper';
import inovexLogo from '../../../assets/inovex-logo.svg';

const Footer = () => {
useEffect(() => {
const logoImage = document.querySelector('ino-img#attributions');

if (logoImage) {
logoImage.setAttribute('src', inovexLogo);
}
}, []);

return <PatternWrapper htmlContent={htmlContent} />;
};

export default Footer;
Loading

0 comments on commit bcfc216

Please sign in to comment.