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

トップページのサンプル実装 #7

Merged
merged 9 commits into from
Aug 6, 2023
Merged
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
META_ROBOTS=""
12 changes: 12 additions & 0 deletions src/app/_components/Caption.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Meta, StoryObj } from '@storybook/react';
import Caption from './Caption';

const meta = {
title: 'app/index/Caption',
component: Caption,
} satisfies Meta<typeof Caption>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {};
79 changes: 79 additions & 0 deletions src/app/_components/Caption.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
'use client';

import { styled } from '@mui/material/styles';

const Caption = () => {
return (
<div>
<div style={{ padding: '16px' }}>
<Title>
<span>Cuculus</span>
<span>&nbsp;</span>
<span>Roadmap</span>
</Title>
<Description>
<span>CuculusはTwitterに替わる場所として</span>
<span>開発される新しいSNSです。</span>
<span>事前に計画を公開することでプロジェクトの方向性を共有し、</span>
<span>フィードバックや意見を収集したいと考えています。</span>
</Description>
</div>
</div>
);
};

const Title = styled('h1')`
display: flex;
justify-content: center;
text-align: center;
flex-wrap: wrap;
margin-top: 16px;
margin-bottom: 16px;
font-family:
'General Sans',
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol';

font-size: 112px;

${({ theme }) => theme.breakpoints.down('laptop')} {
font-size: 80px;
}

${({ theme }) => theme.breakpoints.down('tablet')} {
font-size: 72px;
}

font-weight: 600;
color: #00ced1;
`;

const Description = styled('div')`
font-weight: 400;
text-align: center;
margin: 0 auto;
padding-right: 16px;
padding-left: 16px;
color: #334155;

max-width: 780px;
font-size: 24px;

${({ theme }) => theme.breakpoints.down('laptop')} {
max-width: 530px;
}

${({ theme }) => theme.breakpoints.down('tablet')} {
max-width: 480px;
}
`;

export default Caption;
5 changes: 5 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import '@/styles/globals.css';

import type { Metadata } from 'next';
import EmotionRegistry from '@/components/provider/Registry';
import React from 'react';
import Header from '@/components/header/Header';
import CssBaseline from '@mui/material/CssBaseline';

export const metadata: Metadata = {
title: 'Cuculus Roadmap',
description: 'Generated by create next app',
robots: process.env.META_ROBOTS,
};

export default function RootLayout({
Expand All @@ -16,6 +20,7 @@ export default function RootLayout({
return (
<html lang="ja">
<head />
<CssBaseline />
<body>
<EmotionRegistry>
<Header />
Expand Down
8 changes: 7 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import Caption from '@/app/_components/Caption';

export default function Home() {
return <main>Home</main>;
return (
<main>
<Caption />
</main>
);
}
2 changes: 1 addition & 1 deletion src/components/header/Header.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import Header from './Header';

const meta = {
title: 'header/Header',
title: 'components/header/Header',
component: Header,
} satisfies Meta<typeof Header>;

Expand Down
2 changes: 1 addition & 1 deletion src/components/header/Logo.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import Logo from './Logo';

const meta = {
title: 'header/Logo',
title: 'components/header/Logo',
component: Logo,
} satisfies Meta<typeof Logo>;

Expand Down
5 changes: 5 additions & 0 deletions src/types/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare namespace NodeJS {
interface ProcessEnv {
readonly META_ROBOTS?: string;
}
}
3 changes: 3 additions & 0 deletions sst.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default {
: `${stack.stage}.about.cuculus.jp`,
hostedZone: 'cuculus.jp',
},
environment: {
META_ROBOTS: stack.stage == 'prod' ? '' : 'noindex',
},
});

stack.addOutputs({
Expand Down