Skip to content

Commit 02b7061

Browse files
committed
add user section component
1 parent 3887bc8 commit 02b7061

File tree

6 files changed

+57
-8
lines changed

6 files changed

+57
-8
lines changed

new/src/components/CrosswordPreview/crossword-preview.scss

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
$block-class: 'crossword-preview';
1+
@use '../../styles/_variables' as *;
22

3-
$base-preview-box-size: 8px;
4-
// the base size of a box times the base number of boxes
5-
// plus one for the extra margin
6-
$preview-size: $base-preview-box-size * 15 + 1;
7-
$preview-margin: 20px;
8-
$preview-space: $preview-size + $preview-margin * 2;
3+
$block-class: 'crossword-preview';
94

105
@at-root {
116
.#{$block-class} {

new/src/components/Header/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const Header = () => {
9898

9999
const handleLogout = useCallback(() => {
100100
auth.signOut();
101-
}, []);
101+
}, [auth]);
102102

103103
return (
104104
<HeaderPresentation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { Meta, StoryObj } from "@storybook/react";
2+
3+
import { UserSection } from ".";
4+
5+
const meta = {
6+
title: "Example/User/UserSection",
7+
component: UserSection,
8+
parameters: {
9+
layout: "centered",
10+
},
11+
tags: ["autodocs"],
12+
argTypes: {},
13+
} satisfies Meta<typeof UserSection>;
14+
15+
export default meta;
16+
type Story = StoryObj<typeof meta>;
17+
18+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
19+
export const Basic: Story = {
20+
args: {
21+
children: "section content",
22+
},
23+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
3+
import { block } from "../../../styles";
4+
5+
import "./user-section.scss";
6+
7+
const bem = block("user-section");
8+
9+
export const UserSection: React.FC<{ children: React.ReactNode }> = ({
10+
children,
11+
}) => <div className={bem()}>{children}</div>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@use '../../../styles/_variables' as *;
2+
3+
$block-class: 'user-section';
4+
5+
$number-of-previews: 4;
6+
7+
@at-root {
8+
.#{$block-class} {
9+
max-width: $preview-space * $number-of-previews;
10+
margin-left: auto;
11+
margin-right: auto;
12+
margin-bottom: 20px;
13+
}
14+
}

new/src/styles/_variables.scss

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$base-preview-box-size: 8px;
2+
// the base size of a box times the base number of boxes
3+
// plus one for the extra margin
4+
$preview-size: $base-preview-box-size * 15 + 1;
5+
$preview-margin: 20px;
6+
$preview-space: $preview-size + $preview-margin * 2;

0 commit comments

Comments
 (0)