make register and login to layout
This commit is contained in:
parent
b47720cc4e
commit
c4f7d60016
@ -6,6 +6,7 @@ import type { CallToAction as Props } from '~/types';
|
||||
const {
|
||||
variant = 'secondary',
|
||||
target,
|
||||
link,
|
||||
text = Astro.slots.render('default'),
|
||||
icon = '',
|
||||
class: className = '',
|
||||
@ -31,6 +32,7 @@ const variants = {
|
||||
<a
|
||||
class={twMerge(variants[variant] || '', className)}
|
||||
{...(target ? { target: target, rel: 'noopener noreferrer' } : {})}
|
||||
{...(link ? { href: link} : {})}
|
||||
{...rest}
|
||||
>
|
||||
<Fragment set:html={text} />
|
||||
|
@ -1,166 +1,173 @@
|
||||
---
|
||||
import { Icon } from 'astro-icon/components';
|
||||
import Logo from '~/components/Logo.astro';
|
||||
import ToggleTheme from '~/components/common/ToggleTheme.astro';
|
||||
import ToggleMenu from '~/components/common/ToggleMenu.astro';
|
||||
import Button from '~/components/ui/Button.astro';
|
||||
import { Icon } from 'astro-icon/components'
|
||||
import Logo from 'components/Logo.astro'
|
||||
import ToggleTheme from 'components/common/ToggleTheme.astro'
|
||||
import ToggleMenu from 'components/common/ToggleMenu.astro'
|
||||
import Button from 'components/ui/Button.astro'
|
||||
|
||||
import { getHomePermalink } from '~/utils/permalinks';
|
||||
import { trimSlash, getAsset } from '~/utils/permalinks';
|
||||
import type { CallToAction } from '~/types';
|
||||
import { getHomePermalink } from 'utils/permalinks'
|
||||
import { trimSlash, getAsset } from 'utils/permalinks'
|
||||
import type { CallToAction } from 'types'
|
||||
|
||||
const pb = Astro.locals.pb
|
||||
|
||||
const connected = pb.authStore.isValid
|
||||
interface Link {
|
||||
text?: string;
|
||||
href?: string;
|
||||
ariaLabel?: string;
|
||||
icon?: string;
|
||||
text?: string
|
||||
href?: string
|
||||
ariaLabel?: string
|
||||
icon?: string
|
||||
}
|
||||
|
||||
interface ActionLink extends CallToAction {}
|
||||
|
||||
interface MenuLink extends Link {
|
||||
links?: Array<MenuLink>;
|
||||
links?: Array<MenuLink>
|
||||
}
|
||||
|
||||
export interface Props {
|
||||
id?: string;
|
||||
links?: Array<MenuLink>;
|
||||
actions?: Array<ActionLink>;
|
||||
isSticky?: boolean;
|
||||
isDark?: boolean;
|
||||
isFullWidth?: boolean;
|
||||
showToggleTheme?: boolean;
|
||||
showRssFeed?: boolean;
|
||||
position?: string;
|
||||
id?: string
|
||||
links?: Array<MenuLink>
|
||||
actions?: Array<ActionLink>
|
||||
isSticky?: boolean
|
||||
isDark?: boolean
|
||||
isFullWidth?: boolean
|
||||
showToggleTheme?: boolean
|
||||
showRssFeed?: boolean
|
||||
position?: string
|
||||
}
|
||||
|
||||
const {
|
||||
id = 'header',
|
||||
links = [],
|
||||
actions = [],
|
||||
isSticky = false,
|
||||
isDark = false,
|
||||
isFullWidth = false,
|
||||
showToggleTheme = false,
|
||||
showRssFeed = false,
|
||||
position = 'center',
|
||||
} = Astro.props;
|
||||
id = 'header',
|
||||
links = [],
|
||||
actions = [],
|
||||
isSticky = false,
|
||||
isDark = false,
|
||||
isFullWidth = false,
|
||||
showToggleTheme = false,
|
||||
showRssFeed = false,
|
||||
position = 'center',
|
||||
} = Astro.props
|
||||
|
||||
const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`;
|
||||
const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`
|
||||
---
|
||||
|
||||
<header
|
||||
class:list={[
|
||||
{ sticky: isSticky, relative: !isSticky, dark: isDark },
|
||||
'top-0 z-40 flex-none mx-auto w-full border-b border-gray-50/0 transition-[opacity] ease-in-out',
|
||||
]}
|
||||
{...isSticky ? { 'data-aw-sticky-header': true } : {}}
|
||||
{...id ? { id } : {}}
|
||||
class:list={[
|
||||
{ sticky: isSticky, relative: !isSticky, dark: isDark },
|
||||
'top-0 z-40 flex-none mx-auto w-full border-b border-gray-50/0 transition-[opacity] ease-in-out',
|
||||
]}
|
||||
{...isSticky ? { 'data-aw-sticky-header': true } : {}}
|
||||
{...id ? { id } : {}}
|
||||
>
|
||||
<div class="absolute inset-0"></div>
|
||||
<div
|
||||
class:list={[
|
||||
'relative text-default py-3 px-3 md:px-6 mx-auto w-full',
|
||||
{
|
||||
'md:flex md:justify-between': position !== 'center',
|
||||
},
|
||||
{
|
||||
'md:grid md:grid-cols-3 md:items-center': position === 'center',
|
||||
},
|
||||
{
|
||||
'max-w-7xl': !isFullWidth,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div class:list={[{ 'mr-auto rtl:mr-0 rtl:ml-auto': position === 'right' }, 'flex justify-between']}>
|
||||
<a class="flex items-center" href={getHomePermalink()}>
|
||||
<Logo />
|
||||
</a>
|
||||
<div class="flex items-center md:hidden">
|
||||
<ToggleMenu />
|
||||
</div>
|
||||
</div>
|
||||
<nav
|
||||
class="items-center w-full md:w-auto hidden md:flex md:mx-5 text-default overflow-y-auto overflow-x-hidden md:overflow-y-visible md:overflow-x-auto md:justify-self-center"
|
||||
aria-label="Main navigation"
|
||||
>
|
||||
<ul
|
||||
class="flex flex-col md:flex-row md:self-center w-full md:w-auto text-xl md:text-[0.9375rem] tracking-[0.01rem] font-medium md:justify-center"
|
||||
>
|
||||
{
|
||||
links.map(({ text, href, links }) => (
|
||||
<li class={links?.length ? 'dropdown' : ''}>
|
||||
{links?.length ? (
|
||||
<>
|
||||
<button type="button" class="hover:text-link dark:hover:text-white px-4 py-3 flex items-center">
|
||||
{text}{' '}
|
||||
<Icon name="tabler:chevron-down" class="w-3.5 h-3.5 ml-0.5 rtl:ml-0 rtl:mr-0.5 hidden md:inline" />
|
||||
</button>
|
||||
<ul class="dropdown-menu md:backdrop-blur-md dark:md:bg-dark rounded md:absolute pl-4 md:pl-0 md:hidden font-medium md:bg-white/90 md:min-w-[200px] drop-shadow-xl">
|
||||
{links.map(({ text: text2, href: href2 }) => (
|
||||
<li>
|
||||
<a
|
||||
class:list={[
|
||||
'first:rounded-t last:rounded-b md:hover:bg-gray-100 hover:text-link dark:hover:text-white dark:hover:bg-gray-700 py-2 px-5 block whitespace-no-wrap',
|
||||
{ 'aw-link-active': href2 === currentPath },
|
||||
]}
|
||||
href={href2}
|
||||
>
|
||||
{text2}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
) : (
|
||||
<a
|
||||
class:list={[
|
||||
'hover:text-link dark:hover:text-white px-4 py-3 flex items-center',
|
||||
{ 'aw-link-active': href === currentPath },
|
||||
]}
|
||||
href={href}
|
||||
>
|
||||
{text}
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</nav>
|
||||
<div
|
||||
class:list={[
|
||||
{ 'ml-auto rtl:ml-0 rtl:mr-auto': position === 'left' },
|
||||
'hidden md:self-center md:flex items-center md:mb-0 fixed w-full md:w-auto md:static justify-end left-0 rtl:left-auto rtl:right-0 bottom-0 p-3 md:p-0 md:justify-self-end',
|
||||
]}
|
||||
>
|
||||
<div class="items-center flex justify-between w-full md:w-auto">
|
||||
<div class="flex">
|
||||
{showToggleTheme && <ToggleTheme iconClass="w-6 h-6 md:w-5 md:h-5 md:inline-block" />}
|
||||
{
|
||||
showRssFeed && (
|
||||
<a
|
||||
class="text-muted dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center"
|
||||
aria-label="RSS Feed"
|
||||
href={getAsset('/rss.xml')}
|
||||
>
|
||||
<Icon name="tabler:rss" class="w-5 h-5" />
|
||||
</a>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
{
|
||||
actions?.length ? (
|
||||
<span class="ml-4 rtl:ml-0 rtl:mr-4">
|
||||
{actions.map((btnProps) => (
|
||||
<Button {...btnProps} class="ml-2 py-2.5 px-5.5 md:px-6 font-semibold shadow-none text-sm w-auto" />
|
||||
))}
|
||||
</span>
|
||||
) : (
|
||||
''
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="absolute inset-0"></div>
|
||||
<div
|
||||
class:list={[
|
||||
'relative text-default py-3 px-3 md:px-6 mx-auto w-full',
|
||||
{
|
||||
'md:flex md:justify-between': position !== 'center',
|
||||
},
|
||||
{
|
||||
'md:grid md:grid-cols-3 md:items-center': position === 'center',
|
||||
},
|
||||
{
|
||||
'max-w-7xl': !isFullWidth,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div class:list={[{ 'mr-auto rtl:mr-0 rtl:ml-auto': position === 'right' }, 'flex justify-between']}>
|
||||
<a class="flex items-center" href={getHomePermalink()}>
|
||||
<Logo />
|
||||
</a>
|
||||
<div class="flex items-center md:hidden">
|
||||
<ToggleMenu />
|
||||
</div>
|
||||
</div>
|
||||
<nav
|
||||
class="items-center w-full md:w-auto hidden md:flex md:mx-5 text-default overflow-y-auto overflow-x-hidden md:overflow-y-visible md:overflow-x-auto md:justify-self-center"
|
||||
aria-label="Main navigation"
|
||||
>
|
||||
<ul
|
||||
class="flex flex-col md:flex-row md:self-center w-full md:w-auto text-xl md:text-[0.9375rem] tracking-[0.01rem] font-medium md:justify-center"
|
||||
>
|
||||
{
|
||||
links.map(({ text, href, links }) => (
|
||||
<li class={links?.length ? 'dropdown' : ''}>
|
||||
{links?.length ? (
|
||||
<>
|
||||
<button type="button" class="hover:text-link dark:hover:text-white px-4 py-3 flex items-center">
|
||||
{text}{' '}
|
||||
<Icon name="tabler:chevron-down" class="w-3.5 h-3.5 ml-0.5 rtl:ml-0 rtl:mr-0.5 hidden md:inline" />
|
||||
</button>
|
||||
<ul class="dropdown-menu md:backdrop-blur-md dark:md:bg-dark rounded md:absolute pl-4 md:pl-0 md:hidden font-medium md:bg-white/90 md:min-w-[200px] drop-shadow-xl">
|
||||
{links.map(({ text: text2, href: href2 }) => (
|
||||
<li>
|
||||
<a
|
||||
class:list={[
|
||||
'first:rounded-t last:rounded-b md:hover:bg-gray-100 hover:text-link dark:hover:text-white dark:hover:bg-gray-700 py-2 px-5 block whitespace-no-wrap',
|
||||
{ 'aw-link-active': href2 === currentPath },
|
||||
]}
|
||||
href={href2}
|
||||
>
|
||||
{text2}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
) : (
|
||||
<a
|
||||
class:list={[
|
||||
'hover:text-link dark:hover:text-white px-4 py-3 flex items-center',
|
||||
{ 'aw-link-active': href === currentPath },
|
||||
]}
|
||||
href={href}
|
||||
>
|
||||
{text}
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</nav>
|
||||
<div
|
||||
class:list={[
|
||||
{ 'ml-auto rtl:ml-0 rtl:mr-auto': position === 'left' },
|
||||
'hidden md:self-center md:flex items-center md:mb-0 fixed w-full md:w-auto md:static justify-end left-0 rtl:left-auto rtl:right-0 bottom-0 p-3 md:p-0 md:justify-self-end',
|
||||
]}
|
||||
>
|
||||
<div class="items-center flex justify-between w-full md:w-auto">
|
||||
<div class="flex">
|
||||
{showToggleTheme && <ToggleTheme iconClass="w-6 h-6 md:w-5 md:h-5 md:inline-block" />}
|
||||
{
|
||||
showRssFeed && (
|
||||
<a
|
||||
class="text-muted dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center"
|
||||
aria-label="RSS Feed"
|
||||
href={getAsset('/rss.xml')}
|
||||
>
|
||||
<Icon name="tabler:rss" class="w-5 h-5" />
|
||||
</a>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
{ !connected && (
|
||||
<span class="ml-4 rtl:ml-0 rtl:mr-4">
|
||||
<Button link='/account/login' variant='primary' class="ml-2 py-2.5 px-5.5 md:px-6 font-semibold shadow-none text-sm w-auto">
|
||||
Connexion
|
||||
</Button>
|
||||
<Button link='/account/register' variant='secondary' class="ml-2 py-2.5 px-5.5 md:px-6 font-semibold shadow-none text-sm w-auto">
|
||||
Inscription
|
||||
</Button>
|
||||
</span>
|
||||
)}
|
||||
{ connected && (
|
||||
<Button link='/account/logout' variant='primary' class="ml-2 py-2.5 px-5.5 md:px-6 font-semibold shadow-none text-sm w-auto">
|
||||
Déconnexion
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
@ -21,7 +21,7 @@ const { metadata } = Astro.props;
|
||||
<Announcement />
|
||||
</slot> -->
|
||||
<slot name="header">
|
||||
<Header {...headerData} isSticky showRssFeed showToggleTheme />
|
||||
<Header {...headerData} isSticky showToggleTheme />
|
||||
</slot>
|
||||
<main>
|
||||
<slot />
|
||||
|
@ -1,183 +1,166 @@
|
||||
import { getPermalink, getBlogPermalink, getAsset } from './utils/permalinks';
|
||||
import { getPermalink, getBlogPermalink } from './utils/permalinks'
|
||||
|
||||
export const headerData = {
|
||||
links: [
|
||||
{
|
||||
text: 'Homes',
|
||||
links: [
|
||||
{
|
||||
text: 'SaaS',
|
||||
href: getPermalink('/homes/saas'),
|
||||
},
|
||||
{
|
||||
text: 'Startup',
|
||||
href: getPermalink('/homes/startup'),
|
||||
},
|
||||
{
|
||||
text: 'Mobile App',
|
||||
href: getPermalink('/homes/mobile-app'),
|
||||
},
|
||||
{
|
||||
text: 'Personal',
|
||||
href: getPermalink('/homes/personal'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Pages',
|
||||
links: [
|
||||
{
|
||||
text: 'Features (Anchor Link)',
|
||||
href: getPermalink('/#features'),
|
||||
},
|
||||
{
|
||||
text: 'Services',
|
||||
href: getPermalink('/services'),
|
||||
},
|
||||
{
|
||||
text: 'Pricing',
|
||||
href: getPermalink('/pricing'),
|
||||
},
|
||||
{
|
||||
text: 'About us',
|
||||
href: getPermalink('/about'),
|
||||
},
|
||||
{
|
||||
text: 'Contact',
|
||||
href: getPermalink('/contact'),
|
||||
},
|
||||
{
|
||||
text: 'Terms',
|
||||
href: getPermalink('/terms'),
|
||||
},
|
||||
{
|
||||
text: 'Privacy policy',
|
||||
href: getPermalink('/privacy'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Landing',
|
||||
links: [
|
||||
{
|
||||
text: 'Lead Generation',
|
||||
href: getPermalink('/landing/lead-generation'),
|
||||
},
|
||||
{
|
||||
text: 'Long-form Sales',
|
||||
href: getPermalink('/landing/sales'),
|
||||
},
|
||||
{
|
||||
text: 'Click-Through',
|
||||
href: getPermalink('/landing/click-through'),
|
||||
},
|
||||
{
|
||||
text: 'Product Details (or Services)',
|
||||
href: getPermalink('/landing/product'),
|
||||
},
|
||||
{
|
||||
text: 'Coming Soon or Pre-Launch',
|
||||
href: getPermalink('/landing/pre-launch'),
|
||||
},
|
||||
{
|
||||
text: 'Subscription',
|
||||
href: getPermalink('/landing/subscription'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Blog',
|
||||
links: [
|
||||
{
|
||||
text: 'Blog List',
|
||||
href: getBlogPermalink(),
|
||||
},
|
||||
{
|
||||
text: 'Article',
|
||||
href: getPermalink('get-started-website-with-astro-tailwind-css', 'post'),
|
||||
},
|
||||
{
|
||||
text: 'Article (with MDX)',
|
||||
href: getPermalink('markdown-elements-demo-post', 'post'),
|
||||
},
|
||||
{
|
||||
text: 'Category Page',
|
||||
href: getPermalink('tutorials', 'category'),
|
||||
},
|
||||
{
|
||||
text: 'Tag Page',
|
||||
href: getPermalink('astro', 'tag'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Widgets',
|
||||
href: '#',
|
||||
},
|
||||
],
|
||||
actions: [{ text: 'Download', href: 'https://github.com/onwidget/astrowind', target: '_blank' }],
|
||||
};
|
||||
links: [
|
||||
{
|
||||
text: 'Homes',
|
||||
links: [
|
||||
{
|
||||
text: 'SaaS',
|
||||
href: getPermalink('/homes/saas'),
|
||||
},
|
||||
{
|
||||
text: 'Startup',
|
||||
href: getPermalink('/homes/startup'),
|
||||
},
|
||||
{
|
||||
text: 'Mobile App',
|
||||
href: getPermalink('/homes/mobile-app'),
|
||||
},
|
||||
{
|
||||
text: 'Personal',
|
||||
href: getPermalink('/homes/personal'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Pages',
|
||||
links: [
|
||||
{
|
||||
text: 'Features (Anchor Link)',
|
||||
href: getPermalink('/#features'),
|
||||
},
|
||||
{
|
||||
text: 'Services',
|
||||
href: getPermalink('/services'),
|
||||
},
|
||||
{
|
||||
text: 'Pricing',
|
||||
href: getPermalink('/pricing'),
|
||||
},
|
||||
{
|
||||
text: 'About us',
|
||||
href: getPermalink('/about'),
|
||||
},
|
||||
{
|
||||
text: 'Contact',
|
||||
href: getPermalink('/contact'),
|
||||
},
|
||||
{
|
||||
text: 'Terms',
|
||||
href: getPermalink('/terms'),
|
||||
},
|
||||
{
|
||||
text: 'Privacy policy',
|
||||
href: getPermalink('/privacy'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Landing',
|
||||
links: [
|
||||
{
|
||||
text: 'Lead Generation',
|
||||
href: getPermalink('/landing/lead-generation'),
|
||||
},
|
||||
{
|
||||
text: 'Long-form Sales',
|
||||
href: getPermalink('/landing/sales'),
|
||||
},
|
||||
{
|
||||
text: 'Click-Through',
|
||||
href: getPermalink('/landing/click-through'),
|
||||
},
|
||||
{
|
||||
text: 'Product Details (or Services)',
|
||||
href: getPermalink('/landing/product'),
|
||||
},
|
||||
{
|
||||
text: 'Coming Soon or Pre-Launch',
|
||||
href: getPermalink('/landing/pre-launch'),
|
||||
},
|
||||
{
|
||||
text: 'Subscription',
|
||||
href: getPermalink('/landing/subscription'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Blog',
|
||||
links: [
|
||||
{
|
||||
text: 'Blog List',
|
||||
href: getBlogPermalink(),
|
||||
},
|
||||
{
|
||||
text: 'Article',
|
||||
href: getPermalink(
|
||||
'get-started-website-with-astro-tailwind-css',
|
||||
'post'
|
||||
),
|
||||
},
|
||||
{
|
||||
text: 'Article (with MDX)',
|
||||
href: getPermalink('markdown-elements-demo-post', 'post'),
|
||||
},
|
||||
{
|
||||
text: 'Category Page',
|
||||
href: getPermalink('tutorials', 'category'),
|
||||
},
|
||||
{
|
||||
text: 'Tag Page',
|
||||
href: getPermalink('astro', 'tag'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Widgets',
|
||||
href: '#',
|
||||
},
|
||||
],
|
||||
// actions: [
|
||||
// {
|
||||
// text: 'Connexion',
|
||||
// href: '',
|
||||
// target: '_blank',
|
||||
// },
|
||||
// ],
|
||||
}
|
||||
|
||||
export const footerData = {
|
||||
links: [
|
||||
{
|
||||
title: 'Product',
|
||||
links: [
|
||||
{ text: 'Features', href: '#' },
|
||||
{ text: 'Security', href: '#' },
|
||||
{ text: 'Team', href: '#' },
|
||||
{ text: 'Enterprise', href: '#' },
|
||||
{ text: 'Customer stories', href: '#' },
|
||||
{ text: 'Pricing', href: '#' },
|
||||
{ text: 'Resources', href: '#' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Platform',
|
||||
links: [
|
||||
{ text: 'Developer API', href: '#' },
|
||||
{ text: 'Partners', href: '#' },
|
||||
{ text: 'Atom', href: '#' },
|
||||
{ text: 'Electron', href: '#' },
|
||||
{ text: 'AstroWind Desktop', href: '#' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Support',
|
||||
links: [
|
||||
{ text: 'Docs', href: '#' },
|
||||
{ text: 'Community Forum', href: '#' },
|
||||
{ text: 'Professional Services', href: '#' },
|
||||
{ text: 'Skills', href: '#' },
|
||||
{ text: 'Status', href: '#' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Company',
|
||||
links: [
|
||||
{ text: 'About', href: '#' },
|
||||
{ text: 'Blog', href: '#' },
|
||||
{ text: 'Careers', href: '#' },
|
||||
{ text: 'Press', href: '#' },
|
||||
{ text: 'Inclusion', href: '#' },
|
||||
{ text: 'Social Impact', href: '#' },
|
||||
{ text: 'Shop', href: '#' },
|
||||
],
|
||||
},
|
||||
],
|
||||
secondaryLinks: [
|
||||
{ text: 'Terms', href: getPermalink('/terms') },
|
||||
{ text: 'Privacy Policy', href: getPermalink('/privacy') },
|
||||
],
|
||||
socialLinks: [
|
||||
{ ariaLabel: 'X', icon: 'tabler:brand-x', href: '#' },
|
||||
{ ariaLabel: 'Instagram', icon: 'tabler:brand-instagram', href: '#' },
|
||||
{ ariaLabel: 'Facebook', icon: 'tabler:brand-facebook', href: '#' },
|
||||
{ ariaLabel: 'RSS', icon: 'tabler:rss', href: getAsset('/rss.xml') },
|
||||
{ ariaLabel: 'Github', icon: 'tabler:brand-github', href: 'https://github.com/onwidget/astrowind' },
|
||||
],
|
||||
footNote: `
|
||||
<img class="w-5 h-5 md:w-6 md:h-6 md:-mt-0.5 bg-cover mr-1.5 rtl:mr-0 rtl:ml-1.5 float-left rtl:float-right rounded-sm" src="https://onwidget.com/favicon/favicon-32x32.png" alt="onWidget logo" loading="lazy"></img>
|
||||
Made by <a class="text-blue-600 underline dark:text-muted" href="https://onwidget.com/"> onWidget</a> · All rights reserved.
|
||||
`,
|
||||
};
|
||||
links: [
|
||||
{
|
||||
title: 'Product',
|
||||
links: [
|
||||
{ text: 'Features', href: '#' },
|
||||
{ text: 'Security', href: '#' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Platform',
|
||||
links: [
|
||||
{ text: 'Developer API', href: '#' },
|
||||
{ text: 'Partners', href: '#' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Support',
|
||||
links: [
|
||||
{ text: 'Docs', href: '#' },
|
||||
{ text: 'Community Forum', href: '#' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Company',
|
||||
links: [
|
||||
{ text: 'About', href: '#' },
|
||||
{ text: 'Blog', href: '#' },
|
||||
],
|
||||
},
|
||||
],
|
||||
secondaryLinks: [
|
||||
{ text: 'Terms', href: getPermalink('/terms') },
|
||||
{ text: 'Privacy Policy', href: getPermalink('/privacy') },
|
||||
],
|
||||
socialLinks:[]
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
---
|
||||
import Layout from 'layouts/Layout.astro'
|
||||
import Layout from 'layouts/PageLayout.astro';
|
||||
//import Layout from 'layouts/Layout.astro';
|
||||
import PocketBase from 'pocketbase'
|
||||
|
||||
|
||||
@ -11,11 +12,12 @@ if(!auth.isValid){
|
||||
return Astro.redirect("/account/login");
|
||||
}
|
||||
|
||||
const metadata = {
|
||||
title: 'Account',
|
||||
ignoreTitleTemplate: true,
|
||||
};
|
||||
---
|
||||
|
||||
<Layout title="Account setting">
|
||||
<Layout metadata={metadata}>
|
||||
<h1>Bonjour {user!.username}</h1>
|
||||
<div>
|
||||
<a href="/account/logout">deconnexion</a>
|
||||
</div>
|
||||
</Layout>
|
||||
|
@ -1,5 +1,6 @@
|
||||
---
|
||||
import Layout from "layouts/Layout.astro";
|
||||
import Layout from 'layouts/PageLayout.astro';
|
||||
//import Layout from 'layouts/Layout.astro';
|
||||
import AstroUtils from "libs/AstroUtils";
|
||||
import PocketBase from 'pocketbase'
|
||||
|
||||
@ -29,9 +30,14 @@ const res = await AstroUtils.wrap(async () => {
|
||||
return Astro.redirect("/account/login");// route('/account/login', {message: 'Compte invalide, valider les identifiants'})) //XXX: comprendre comment le system de route fonctionne
|
||||
}
|
||||
})
|
||||
|
||||
const metadata = {
|
||||
title: 'Login',
|
||||
ignoreTitleTemplate: true,
|
||||
};
|
||||
---
|
||||
|
||||
<Layout title="login">
|
||||
<Layout metadata={metadata}>
|
||||
<form id="account-creation" method="post" enctype="multipart/form-data">
|
||||
<input required name="username" placeholder="Pseudo ou email"/>
|
||||
<input required name="password" type="password" placeholder="Mot de passe" />
|
||||
|
@ -8,6 +8,6 @@ if(pb.authStore.isValid){
|
||||
pb.authStore.clear()
|
||||
}
|
||||
|
||||
return Astro.redirect('/account/login')
|
||||
return Astro.redirect('/')
|
||||
|
||||
---
|
@ -58,7 +58,7 @@ await AstroUtils.wrap(async () => {
|
||||
})
|
||||
|
||||
const metadata = {
|
||||
title: 'register',
|
||||
title: 'Register',
|
||||
ignoreTitleTemplate: true,
|
||||
};
|
||||
---
|
||||
|
306
front/src/types.d.ts
vendored
306
front/src/types.d.ts
vendored
@ -1,288 +1,288 @@
|
||||
import type { AstroComponentFactory } from 'astro/runtime/server/index.js';
|
||||
import type { HTMLAttributes, ImageMetadata } from 'astro/types';
|
||||
import type { AstroComponentFactory } from 'astro/runtime/server/index.js'
|
||||
import type { HTMLAttributes, ImageMetadata } from 'astro/types'
|
||||
|
||||
export interface Post {
|
||||
/** A unique ID number that identifies a post. */
|
||||
id: string;
|
||||
id: string
|
||||
|
||||
/** A post’s unique slug – part of the post’s URL based on its name, i.e. a post called “My Sample Page” has a slug “my-sample-page”. */
|
||||
slug: string;
|
||||
slug: string
|
||||
|
||||
/** */
|
||||
permalink: string;
|
||||
permalink: string
|
||||
|
||||
/** */
|
||||
publishDate: Date;
|
||||
publishDate: Date
|
||||
/** */
|
||||
updateDate?: Date;
|
||||
updateDate?: Date
|
||||
|
||||
/** */
|
||||
title: string;
|
||||
title: string
|
||||
/** Optional summary of post content. */
|
||||
excerpt?: string;
|
||||
excerpt?: string
|
||||
/** */
|
||||
image?: ImageMetadata | string;
|
||||
image?: ImageMetadata | string
|
||||
|
||||
/** */
|
||||
category?: Taxonomy;
|
||||
category?: Taxonomy
|
||||
/** */
|
||||
tags?: Taxonomy[];
|
||||
tags?: Taxonomy[]
|
||||
/** */
|
||||
author?: string;
|
||||
author?: string
|
||||
|
||||
/** */
|
||||
metadata?: MetaData;
|
||||
metadata?: MetaData
|
||||
|
||||
/** */
|
||||
draft?: boolean;
|
||||
draft?: boolean
|
||||
|
||||
/** */
|
||||
Content?: AstroComponentFactory;
|
||||
content?: string;
|
||||
Content?: AstroComponentFactory
|
||||
content?: string
|
||||
|
||||
/** */
|
||||
readingTime?: number;
|
||||
readingTime?: number
|
||||
}
|
||||
|
||||
export interface Taxonomy {
|
||||
slug: string;
|
||||
title: string;
|
||||
slug: string
|
||||
title: string
|
||||
}
|
||||
|
||||
export interface MetaData {
|
||||
title?: string;
|
||||
ignoreTitleTemplate?: boolean;
|
||||
title?: string
|
||||
ignoreTitleTemplate?: boolean
|
||||
|
||||
canonical?: string;
|
||||
canonical?: string
|
||||
|
||||
robots?: MetaDataRobots;
|
||||
robots?: MetaDataRobots
|
||||
|
||||
description?: string;
|
||||
description?: string
|
||||
|
||||
openGraph?: MetaDataOpenGraph;
|
||||
twitter?: MetaDataTwitter;
|
||||
openGraph?: MetaDataOpenGraph
|
||||
twitter?: MetaDataTwitter
|
||||
}
|
||||
|
||||
export interface MetaDataRobots {
|
||||
index?: boolean;
|
||||
follow?: boolean;
|
||||
index?: boolean
|
||||
follow?: boolean
|
||||
}
|
||||
|
||||
export interface MetaDataImage {
|
||||
url: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
url: string
|
||||
width?: number
|
||||
height?: number
|
||||
}
|
||||
|
||||
export interface MetaDataOpenGraph {
|
||||
url?: string;
|
||||
siteName?: string;
|
||||
images?: Array<MetaDataImage>;
|
||||
locale?: string;
|
||||
type?: string;
|
||||
url?: string
|
||||
siteName?: string
|
||||
images?: Array<MetaDataImage>
|
||||
locale?: string
|
||||
type?: string
|
||||
}
|
||||
|
||||
export interface MetaDataTwitter {
|
||||
handle?: string;
|
||||
site?: string;
|
||||
cardType?: string;
|
||||
handle?: string
|
||||
site?: string
|
||||
cardType?: string
|
||||
}
|
||||
|
||||
export interface Image {
|
||||
src: string;
|
||||
alt?: string;
|
||||
src: string
|
||||
alt?: string
|
||||
}
|
||||
|
||||
export interface Video {
|
||||
src: string;
|
||||
type?: string;
|
||||
src: string
|
||||
type?: string
|
||||
}
|
||||
|
||||
export interface Widget {
|
||||
id?: string;
|
||||
isDark?: boolean;
|
||||
bg?: string;
|
||||
classes?: Record<string, string | Record<string, string>>;
|
||||
id?: string
|
||||
isDark?: boolean
|
||||
bg?: string
|
||||
classes?: Record<string, string | Record<string, string>>
|
||||
}
|
||||
|
||||
export interface Headline {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
tagline?: string;
|
||||
classes?: Record<string, string>;
|
||||
title?: string
|
||||
subtitle?: string
|
||||
tagline?: string
|
||||
classes?: Record<string, string>
|
||||
}
|
||||
|
||||
interface TeamMember {
|
||||
name?: string;
|
||||
job?: string;
|
||||
image?: Image;
|
||||
socials?: Array<Social>;
|
||||
description?: string;
|
||||
classes?: Record<string, string>;
|
||||
name?: string
|
||||
job?: string
|
||||
image?: Image
|
||||
socials?: Array<Social>
|
||||
description?: string
|
||||
classes?: Record<string, string>
|
||||
}
|
||||
|
||||
interface Social {
|
||||
icon?: string;
|
||||
href?: string;
|
||||
icon?: string
|
||||
href?: string
|
||||
}
|
||||
|
||||
export interface Stat {
|
||||
amount?: number | string;
|
||||
title?: string;
|
||||
icon?: string;
|
||||
amount?: number | string
|
||||
title?: string
|
||||
icon?: string
|
||||
}
|
||||
|
||||
export interface Item {
|
||||
title?: string;
|
||||
description?: string;
|
||||
icon?: string;
|
||||
classes?: Record<string, string>;
|
||||
callToAction?: CallToAction;
|
||||
image?: Image;
|
||||
title?: string
|
||||
description?: string
|
||||
icon?: string
|
||||
classes?: Record<string, string>
|
||||
callToAction?: CallToAction
|
||||
image?: Image
|
||||
}
|
||||
|
||||
export interface Price {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
description?: string;
|
||||
price?: number | string;
|
||||
period?: string;
|
||||
items?: Array<Item>;
|
||||
callToAction?: CallToAction;
|
||||
hasRibbon?: boolean;
|
||||
ribbonTitle?: string;
|
||||
title?: string
|
||||
subtitle?: string
|
||||
description?: string
|
||||
price?: number | string
|
||||
period?: string
|
||||
items?: Array<Item>
|
||||
callToAction?: CallToAction
|
||||
hasRibbon?: boolean
|
||||
ribbonTitle?: string
|
||||
}
|
||||
|
||||
export interface Testimonial {
|
||||
title?: string;
|
||||
testimonial?: string;
|
||||
name?: string;
|
||||
job?: string;
|
||||
image?: string | unknown;
|
||||
title?: string
|
||||
testimonial?: string
|
||||
name?: string
|
||||
job?: string
|
||||
image?: string | unknown
|
||||
}
|
||||
|
||||
export interface Input {
|
||||
type: HTMLInputTypeAttribute;
|
||||
name: string;
|
||||
label?: string;
|
||||
autocomplete?: string;
|
||||
placeholder?: string;
|
||||
type: HTMLInputTypeAttribute
|
||||
name: string
|
||||
label?: string
|
||||
autocomplete?: string
|
||||
placeholder?: string
|
||||
}
|
||||
|
||||
export interface Textarea {
|
||||
label?: string;
|
||||
name?: string;
|
||||
placeholder?: string;
|
||||
rows?: number;
|
||||
label?: string
|
||||
name?: string
|
||||
placeholder?: string
|
||||
rows?: number
|
||||
}
|
||||
|
||||
export interface Disclaimer {
|
||||
label?: string;
|
||||
label?: string
|
||||
}
|
||||
|
||||
// COMPONENTS
|
||||
export interface CallToAction extends Omit<HTMLAttributes<'a'>, 'slot'> {
|
||||
variant?: 'primary' | 'secondary' | 'tertiary' | 'link';
|
||||
text?: string;
|
||||
icon?: string;
|
||||
classes?: Record<string, string>;
|
||||
type?: 'button' | 'submit' | 'reset';
|
||||
variant?: 'primary' | 'secondary' | 'tertiary' | 'link'
|
||||
text?: string
|
||||
icon?: string
|
||||
classes?: Record<string, string>
|
||||
type?: 'button' | 'submit' | 'reset'
|
||||
}
|
||||
|
||||
export interface ItemGrid {
|
||||
items?: Array<Item>;
|
||||
columns?: number;
|
||||
defaultIcon?: string;
|
||||
classes?: Record<string, string>;
|
||||
items?: Array<Item>
|
||||
columns?: number
|
||||
defaultIcon?: string
|
||||
classes?: Record<string, string>
|
||||
}
|
||||
|
||||
export interface Collapse {
|
||||
iconUp?: string;
|
||||
iconDown?: string;
|
||||
items?: Array<Item>;
|
||||
columns?: number;
|
||||
classes?: Record<string, string>;
|
||||
iconUp?: string
|
||||
iconDown?: string
|
||||
items?: Array<Item>
|
||||
columns?: number
|
||||
classes?: Record<string, string>
|
||||
}
|
||||
|
||||
export interface Form {
|
||||
inputs?: Array<Input>;
|
||||
textarea?: Textarea;
|
||||
disclaimer?: Disclaimer;
|
||||
button?: string;
|
||||
description?: string;
|
||||
inputs?: Array<Input>
|
||||
textarea?: Textarea
|
||||
disclaimer?: Disclaimer
|
||||
button?: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
// WIDGETS
|
||||
export interface Hero extends Omit<Headline, 'classes'>, Widget {
|
||||
content?: string;
|
||||
image?: string | unknown;
|
||||
callToAction1?: CallToAction;
|
||||
callToAction2?: CallToAction;
|
||||
isReversed?: boolean;
|
||||
content?: string
|
||||
image?: string | unknown
|
||||
callToAction1?: CallToAction
|
||||
callToAction2?: CallToAction
|
||||
isReversed?: boolean
|
||||
}
|
||||
|
||||
export interface Team extends Omit<Headline, 'classes'>, Widget {
|
||||
team?: Array<TeamMember>;
|
||||
team?: Array<TeamMember>
|
||||
}
|
||||
|
||||
export interface Stats extends Omit<Headline, 'classes'>, Widget {
|
||||
stats?: Array<Stat>;
|
||||
stats?: Array<Stat>
|
||||
}
|
||||
|
||||
export interface Pricing extends Omit<Headline, 'classes'>, Widget {
|
||||
prices?: Array<Price>;
|
||||
prices?: Array<Price>
|
||||
}
|
||||
|
||||
export interface Testimonials extends Omit<Headline, 'classes'>, Widget {
|
||||
testimonials?: Array<Testimonial>;
|
||||
callToAction?: CallToAction;
|
||||
testimonials?: Array<Testimonial>
|
||||
callToAction?: CallToAction
|
||||
}
|
||||
|
||||
export interface Brands extends Omit<Headline, 'classes'>, Widget {
|
||||
icons?: Array<string>;
|
||||
images?: Array<Image>;
|
||||
icons?: Array<string>
|
||||
images?: Array<Image>
|
||||
}
|
||||
|
||||
export interface Features extends Omit<Headline, 'classes'>, Widget {
|
||||
image?: string | unknown;
|
||||
video?: Video;
|
||||
items?: Array<Item>;
|
||||
columns?: number;
|
||||
defaultIcon?: string;
|
||||
callToAction1?: CallToAction;
|
||||
callToAction2?: CallToAction;
|
||||
isReversed?: boolean;
|
||||
isBeforeContent?: boolean;
|
||||
isAfterContent?: boolean;
|
||||
image?: string | unknown
|
||||
video?: Video
|
||||
items?: Array<Item>
|
||||
columns?: number
|
||||
defaultIcon?: string
|
||||
callToAction1?: CallToAction
|
||||
callToAction2?: CallToAction
|
||||
isReversed?: boolean
|
||||
isBeforeContent?: boolean
|
||||
isAfterContent?: boolean
|
||||
}
|
||||
|
||||
export interface Faqs extends Omit<Headline, 'classes'>, Widget {
|
||||
iconUp?: string;
|
||||
iconDown?: string;
|
||||
items?: Array<Item>;
|
||||
columns?: number;
|
||||
iconUp?: string
|
||||
iconDown?: string
|
||||
items?: Array<Item>
|
||||
columns?: number
|
||||
}
|
||||
|
||||
export interface Steps extends Omit<Headline, 'classes'>, Widget {
|
||||
items: Array<{
|
||||
title: string;
|
||||
description?: string;
|
||||
icon?: string;
|
||||
classes?: Record<string, string>;
|
||||
}>;
|
||||
callToAction?: string | CallToAction;
|
||||
image?: string | Image;
|
||||
isReversed?: boolean;
|
||||
title: string
|
||||
description?: string
|
||||
icon?: string
|
||||
classes?: Record<string, string>
|
||||
}>
|
||||
callToAction?: string | CallToAction
|
||||
image?: string | Image
|
||||
isReversed?: boolean
|
||||
}
|
||||
|
||||
export interface Content extends Omit<Headline, 'classes'>, Widget {
|
||||
content?: string;
|
||||
image?: string | unknown;
|
||||
items?: Array<Item>;
|
||||
columns?: number;
|
||||
isReversed?: boolean;
|
||||
isAfterContent?: boolean;
|
||||
callToAction?: CallToAction;
|
||||
content?: string
|
||||
image?: string | unknown
|
||||
items?: Array<Item>
|
||||
columns?: number
|
||||
isReversed?: boolean
|
||||
isAfterContent?: boolean
|
||||
callToAction?: CallToAction
|
||||
}
|
||||
|
||||
export interface Contact extends Omit<Headline, 'classes'>, Form, Widget {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user