Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

Commit 08bf1e0

Browse files
committed
Updating typography, input and link component
1 parent 3ac73cd commit 08bf1e0

16 files changed

+74
-41
lines changed

.storybook/preview-head.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<link rel="preconnect" href="https://fonts.gstatic.com">
22
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap" rel="stylesheet">
33
<style>
4+
* {
5+
box-sizing: border-box;
6+
}
47
html {
58
font-size: 10px;
69
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
"@testing-library/react": "^11.1.0",
99
"@testing-library/user-event": "^12.1.10",
1010
"bs-css-emotion": "^2.5.1",
11-
"bs-platform": "8.4.2",
11+
"rescript": "9.1.3",
1212
"react": "^17.0.2",
1313
"react-dom": "^17.0.2",
1414
"react-scripts": "4.0.3",
1515
"web-vitals": "^1.0.1"
1616
},
1717
"scripts": {
18-
"res:watch": "bsb -make-world -w",
19-
"res:build": "bsb -make-world -clean",
20-
"res:clean": "bsb -clean",
18+
"res:watch": "rescript build -w",
19+
"res:build": "rescript build -with-deps",
20+
"res:clean": "rescript clean",
2121
"start": "react-scripts start",
2222
"build": "react-scripts build",
2323
"test": "react-scripts test",

src/components/Card/Card.res

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
open CssJs
22

3-
let card = style(.[
4-
//
3+
let card = style(. [
54
background(Theme.Colors.lightBlue1->hex),
65
borderRadius(Theme.Radius.medium),
76
padding(3.2->rem),
87
])
98

109
@react.component
1110
let make = (~children) => {
12-
<div className={card}>children</div>
11+
<div className={card}> children </div>
1312
}

src/components/Card/Card_Stories.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Card/Card_Stories.res

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ open Render
44
storiesOf("Card", Helpers.storybookModule)
55
->add("Basic usage", () => {
66
<Card>
7-
<Typography level=#h1 variant=#title>
8-
{"ReScript & React.js - Real World App"->s}
9-
</Typography>
10-
11-
<Typography>
12-
{"Texto"->s}
13-
</Typography>
7+
<Typography level=#1 variant=#title> {"ReScript & React.js - Real World App"->s} </Typography>
8+
<Typography> {"Texto"->s} </Typography>
149
</Card>
1510
})
1611
->ignore

src/components/Input/Input.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Link/Link.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Typography/Typography.bs.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
type variant = [#title | #text]
2-
type level = [#h1 | #h2]
2+
type level = [#1 | #2]
33

44
module Styles = {
55
open CssJs
66

7-
let h1 = style(.[
7+
let h1 = style(. [
88
fontSize(3.2->rem),
99
fontFamily(Theme.fontFamily),
1010
fontWeight(#bold),
1111
color(Theme.Colors.black->hex),
1212
])
1313

14-
let h2 = style(.[
14+
let h2 = style(. [
1515
fontSize(2.8->rem),
1616
fontFamily(Theme.fontFamily),
1717
fontWeight(#bold),
1818
color(Theme.Colors.black->hex),
1919
])
2020

21-
let text = style(.[
21+
let text = style(. [
2222
fontSize(2.0->rem),
2323
fontFamily(Theme.fontFamily),
2424
letterSpacing(-0.02->em),
@@ -27,10 +27,10 @@ module Styles = {
2727
}
2828

2929
@react.component
30-
let make = (~variant=#text, ~level: level=#h1, ~children) => {
30+
let make = (~variant=#text, ~level: level=#1, ~children) => {
3131
switch (variant, level) {
32-
| (#title, #h1) => <h1 className={Styles.h1}> children </h1>
33-
| (#title, #h2) => <h2 className={Styles.h2}> children </h2>
32+
| (#title, #1) => <h1 className={Styles.h1}> children </h1>
33+
| (#title, #2) => <h2 className={Styles.h2}> children </h2>
3434
| (#text, _) => <p className={Styles.text}> children </p>
3535
}
3636
}

src/components/Typography/Typography_Stories.bs.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)