Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdeefd64

Browse files
committed
init base
1 parent059e004 commitdeefd64

File tree

23 files changed

+310
-50
lines changed

23 files changed

+310
-50
lines changed

‎.storybook/addons.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import"@storybook/addon-actions/register";
2+
import"@storybook/addon-links/register";

‎.storybook/config.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import{configure}from"@storybook/react";
2+
3+
// import default styles
4+
import"../src/styles";
5+
6+
// automatically import all files ending in *.stories.js
7+
configure(require.context("../src/stories",true,/\.stories\.js$/),module);

‎package.json‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"scripts": {
66
"build":"react-app-rewired build",
77
"start":"react-app-rewired start",
8-
"test":"react-app-rewired test --watchAll=false"
8+
"test":"react-app-rewired test --watchAll=false",
9+
"storybook":"start-storybook -p 9009 -s public",
10+
"build-storybook":"build-storybook -s public"
911
},
1012
"browserslist": {
1113
"production": [
@@ -23,15 +25,26 @@
2325
"extends":"react-app"
2426
},
2527
"dependencies": {
26-
"@testing-library/jest-dom":"^4.2.4",
27-
"@testing-library/react":"^9.4.0",
28-
"@testing-library/user-event":"^8.0.2",
28+
"@fortawesome/fontawesome-svg-core":"^1.2.26",
29+
"@fortawesome/free-solid-svg-icons":"^5.12.0",
30+
"@fortawesome/react-fontawesome":"^0.1.8",
31+
"bootstrap":"^4.4.1",
2932
"react":"^16.12.0",
33+
"react-bootstrap":"^1.0.0-beta.16",
3034
"react-dom":"^16.12.0",
3135
"react-scripts":"^3.3.0"
3236
},
3337
"devDependencies": {
38+
"@storybook/addon-actions":"^5.2.8",
39+
"@storybook/addon-links":"^5.2.8",
40+
"@storybook/addons":"^5.2.8",
41+
"@storybook/react":"^5.2.8",
42+
"@testing-library/dom":"^6.11.0",
43+
"@testing-library/jest-dom":"^4.2.4",
44+
"@testing-library/react":"^9.4.0",
45+
"@testing-library/react-hooks":"^3.2.1",
3446
"jest-tap-reporter":"^1.9.0",
35-
"react-app-rewired":"^2.1.5"
47+
"react-app-rewired":"^2.1.5",
48+
"react-test-renderer":"^16.12.0"
3649
}
3750
}

‎src/App.css‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎src/App.js‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
importReactfrom"react";
2+
importCardfrom"react-bootstrap/Card";
3+
import{MessageForm}from"./components/MessageForm";
4+
import{USER}from"./config";
25

3-
constApp=()=>{
4-
return<div>Welcome to CodeRoad</div>;
5-
};
6+
constApp=()=>(
7+
<divclassName="App">
8+
<CardclassName="Home">
9+
<Card.HeaderclassName="Home_Title">Home</Card.Header>
10+
<Card.BodyclassName="Home_Body">
11+
<MessageFormuser={USER}/>
12+
</Card.Body>
13+
</Card>
14+
</div>
15+
);
616

717
exportdefaultApp;

‎src/components/Avatar/index.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
importReactfrom"react";
2+
importBootstrapImagefrom"react-bootstrap/Image";
3+
4+
exportconstAvatar=({ image})=>(
5+
<BootstrapImagesrc={image}roundedCirclestyle={{height:49,width:49}}/>
6+
);

‎src/components/Card/index.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
importReactfrom"react";
2+
3+
importBootstrapCardfrom"react-bootstrap/Card";
4+
import{Avatar}from"../Avatar";
5+
import"./styles.css";
6+
7+
exportconstCard=({ children, profile_image, className, ...rest})=>{
8+
return(
9+
<BootstrapCardclassName={`Card${className||""}`}{...rest}>
10+
<divclassName="Card_LeftColumn">
11+
<Avatarimage={profile_image}/>
12+
</div>
13+
<divclassName="Card_RightColumn">{children}</div>
14+
</BootstrapCard>
15+
);
16+
};

‎src/components/Card/styles.css‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.Card {
2+
display: flex;
3+
flex-direction: row;
4+
padding:1rem;
5+
width:100%;
6+
}
7+
8+
.Card_LeftColumn {
9+
display: flex;
10+
width:50px;
11+
justify-content: center;
12+
}
13+
14+
.Card_RightColumn {
15+
padding-left:1rem;
16+
width:100%;
17+
}

‎src/components/Icon/Button.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
importReactfrom"react";
2+
3+
exportconstIconButton=({ children, className, ...rest})=>(
4+
<buttonclassName={`Icon_Button${className}`}{...rest}>
5+
{children}
6+
</button>
7+
);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
importReactfrom"react";
2+
3+
exportconstIconCountWrapper=({ children, count, ...rest})=>(
4+
<divclassName="Icon_Countable"{...rest}>
5+
{children}
6+
{count>0&&<spanclassName="Icon_Count">{count}</span>}
7+
</div>
8+
);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp