Skip to content

Commit

Permalink
Refactor Footer component in Layout.astro to update links and add con…
Browse files Browse the repository at this point in the history
…tributors link
  • Loading branch information
Adammatthiesen committed Dec 24, 2024
1 parent 7a886f1 commit b218a97
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
9 changes: 7 additions & 2 deletions packages/studiocms_dashboard/src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
const year = new Date().getFullYear();
const footerYear = year === 2024 ? year : `2024 - ${year}`;
const repoLink = 'https://github.com/withstudiocms/studiocms/';
const licenseLink =
'https://github.com/withstudiocms/studiocms/blob/main/packages/studiocms/LICENSE';
const contributorsLink = 'https://github.com/withstudiocms/studiocms/graphs/contributors';
---
<footer class="dashboard-footer">
<span>&copy; {footerYear} <a href="https://github.com/withstudiocms/studiocms/">withstudiocms/studiocms</a> ― <a href="https://github.com/withstudiocms/studiocms/blob/main/packages/studiocms/LICENSE"><strong>MIT License</strong></a></span>
<span>Developed By <a href="https://github.com/withstudiocms/studiocms/graphs/contributors"><strong>The StudioCMS Contributors</strong></a></span>
<span>&copy; {footerYear} <a href={repoLink}>withstudiocms/studiocms</a> ― <a href={licenseLink}><strong>MIT License</strong></a></span>
<span>Developed By <a href={contributorsLink}><strong>The StudioCMS Contributors</strong></a></span>
</footer>
14 changes: 7 additions & 7 deletions packages/studiocms_dashboard/src/components/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@ const description = propDescription ?? dbConfig.description;
<body>
<Toaster />
{ requiredPermission !== 'none' && (
<>
{
pagePreRendered
<> { pagePreRendered
? <LoginChecker requiredPermission={requiredPermission} server:defer />
: <LoginChecker requiredPermission={requiredPermission} />
}
</>
} </>
) }
{ sidebar === 'single' && <SingleSidebar {pagePreRendered} /> }
{ sidebar === 'double' && <DoubleSidebar {pagePreRendered} /> }

<main>
{ sidebar !== false && (
<Button variant="outlined" color="primary" class="nav-toggle" id={'nav-toggle'}>
<Icon name="bars-3" height={24} width={24} />
</Button>
)}
</Button> )}
<div class="container">

<div class="page-header">
<slot name="header" />
</div>

<slot />

</div>

{ footer && <Footer /> }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { prerenderRoutes as pagePreRendered } from 'studiocms:mode';
// import { useTranslations } from 'studiocms:i18n';
import { Layout } from '../components';
import PageHeader from '../components/PageHeader.astro';
const lang = 'en-us';
// const t = useTranslations(lang, '@studiocms/dashboard:index');
Expand All @@ -15,4 +16,8 @@ const lang = 'en-us';
{lang}
>

<div slot="header">
<PageHeader title="Content Management" />
</div>

</Layout>
4 changes: 4 additions & 0 deletions packages/studiocms_dashboard/src/routes/user-management.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { prerenderRoutes as pagePreRendered } from 'studiocms:mode';
// import { useTranslations } from 'studiocms:i18n';
import { Layout } from '../components';
import PageHeader from '../components/PageHeader.astro';
const lang = 'en-us';
// const t = useTranslations(lang, '@studiocms/dashboard:index');
Expand All @@ -13,5 +14,8 @@ const lang = 'en-us';
{lang}
>

<div slot="header">
<PageHeader title="User Management" />
</div>

</Layout>

0 comments on commit b218a97

Please sign in to comment.