Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added a dot #22

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Carbon Tutorial for NextJS 13

Base NextJS 13 app using IBM Carbon Design System React components
Base NextJS 13 app using IBM Carbon Design System React components.

## Create NextJS 13 app

Expand Down
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {};

module.exports = nextConfig
module.exports = nextConfig;
2 changes: 1 addition & 1 deletion src/app/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.cds--content {
margin-top: 3rem;
padding: 0;
// background: var(--cds-background);
// background: var(--cds-background);
}

.cds--content .cds--css-grid {
Expand Down
2 changes: 1 addition & 1 deletion src/app/home/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
@mixin landing-page-background() {
background-color: $layer-01;
position: relative;
}
}
2 changes: 1 addition & 1 deletion src/app/home/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
.cds--subgrid--wide {
//fix needed to keep the subgrid from scrolling horizontally
margin-right: 1rem;
}
}
2 changes: 1 addition & 1 deletion src/app/home/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '@carbon/react';
import Image from 'next/image';

export function LandingPage() {
export default function LandingPage() {
return (
<Grid className="landing-page" fullWidth>
<Column lg={16} md={8} sm={4} className="landing-page__banner">
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import './globals.scss'
import './globals.scss';

import { Providers } from './providers';

export const metadata = {
title: 'Carbon + Next 13',
description: 'IBM Carbon Tutorial with NextJS 13',
}
};

export default function RootLayout({ children }) {
return (
Expand All @@ -14,5 +14,5 @@ export default function RootLayout({ children }) {
<Providers>{children}</Providers>
</body>
</html>
)
);
}
4 changes: 2 additions & 2 deletions src/app/page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import LandingPage from './home/page';

export default function Page() {
return <LandingPage />;
}
return <LandingPage />;
}
14 changes: 6 additions & 8 deletions src/app/providers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
'use client';

import { Content, Theme } from '@carbon/react';

Expand All @@ -7,12 +7,10 @@ import TutorialHeader from '@/components/TutorialHeader/TutorialHeader';
export function Providers({ children }) {
return (
<div>
<Theme theme="g100">
<TutorialHeader />
</Theme>
<Content>
{children}
</Content>
<Theme theme="g100">
<TutorialHeader />
</Theme>
<Content>{children}</Content>
</div>
)
);
}
2 changes: 1 addition & 1 deletion src/app/repos/_repo-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
.repo-page__r1 {
padding-top: $spacing-05;
padding-bottom: $spacing-05;
}
}
107 changes: 50 additions & 57 deletions src/components/TutorialHeader/TutorialHeader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client'
'use client';

import {
Header,
Expand All @@ -14,68 +14,61 @@ import {
SideNavItems,
HeaderSideNavItems,
} from '@carbon/react';
import {
Switcher,
Notification,
UserAvatar,
} from '@carbon/icons-react';
import { Switcher, Notification, UserAvatar } from '@carbon/icons-react';

import Link from 'next/link';

const TutorialHeader = () => (
<HeaderContainer
render={({ isSideNavExpanded, onClickSideNavExpand }) => (
<Header aria-label="Carbon Tutorial">
<SkipToContent />
<HeaderMenuButton
aria-label="Open menu"
onClick={onClickSideNavExpand}
isActive={isSideNavExpanded}
/>
<Link href="/" passHref legacyBehavior>
<HeaderName prefix="IBM">
Carbon Tutorial
</HeaderName>
</Link>
<HeaderNavigation aria-label="Carbon Tutorial">
<HeaderContainer
render={({ isSideNavExpanded, onClickSideNavExpand }) => (
<Header aria-label="Carbon Tutorial">
<SkipToContent />
<HeaderMenuButton
aria-label="Open menu"
onClick={onClickSideNavExpand}
isActive={isSideNavExpanded}
/>
<Link href="/" passHref legacyBehavior>
<HeaderName prefix="IBM">Carbon Tutorial</HeaderName>
</Link>
<HeaderNavigation aria-label="Carbon Tutorial">
<Link href="/repos" passHref legacyBehavior>
<HeaderMenuItem>Repositories</HeaderMenuItem>
</Link>
</HeaderNavigation>
<SideNav
aria-label="Side navigation"
expanded={isSideNavExpanded}
isPersistent={false}
>
<SideNavItems>
<HeaderSideNavItems>
<Link href="/repos" passHref legacyBehavior>
<HeaderMenuItem >
Repositories
</HeaderMenuItem>
<HeaderMenuItem>Repositories</HeaderMenuItem>
</Link>
</HeaderNavigation>
<SideNav
aria-label="Side navigation"
expanded={isSideNavExpanded}
isPersistent={false}>
<SideNavItems>
<HeaderSideNavItems>
<Link href="/repos" passHref legacyBehavior>
<HeaderMenuItem >
Repositories
</HeaderMenuItem>
</Link>
</HeaderSideNavItems>
</SideNavItems>
</SideNav>
<HeaderGlobalBar>
<HeaderGlobalAction
aria-label="Notifications"
tooltipAlignment="center">
<Notification size={20} />
</HeaderGlobalAction>
<HeaderGlobalAction
aria-label="User Avatar"
tooltipAlignment="center">
<UserAvatar size={20} />
</HeaderGlobalAction>
<HeaderGlobalAction aria-label="App Switcher" tooltipAlignment="end">
<Switcher size={20} />
</HeaderGlobalAction>
</HeaderGlobalBar>
</Header>
)}
/>
</HeaderSideNavItems>
</SideNavItems>
</SideNav>
<HeaderGlobalBar>
<HeaderGlobalAction
aria-label="Notifications"
tooltipAlignment="center"
>
<Notification size={20} />
</HeaderGlobalAction>
<HeaderGlobalAction
aria-label="User Avatar"
tooltipAlignment="center"
>
<UserAvatar size={20} />
</HeaderGlobalAction>
<HeaderGlobalAction aria-label="App Switcher" tooltipAlignment="end">
<Switcher size={20} />
</HeaderGlobalAction>
</HeaderGlobalBar>
</Header>
)}
/>
);

export default TutorialHeader;