File tree 8 files changed +31
-25
lines changed
8 files changed +31
-25
lines changed Original file line number Diff line number Diff line change @@ -108,5 +108,5 @@ storybook-static
108
108
pnpm-lock.yaml
109
109
110
110
# Built files
111
- components
111
+ components / * .js
112
112
assets
Original file line number Diff line number Diff line change 14
14
15
15
< body >
16
16
< elect-staging-banner > </ elect-staging-banner >
17
- < elect-navbar > </ elect-navbar >
17
+ < elect-navbar title =" Some Project " > </ elect-navbar >
18
18
< elect-sharer > </ elect-sharer >
19
19
< elect-footer > </ elect-footer >
20
20
</ body >
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import { Meta , Template , Story } from ' @storybook/addon-svelte-csf' ;
3
3
import NavigationBar from ' ./navbar.wc.svelte' ;
4
+
4
5
</script >
5
6
6
7
<Meta
7
8
title =" Components/navbar"
8
9
component ={NavigationBar }
9
10
argTypes ={{
10
- titleText : { control : ' text' },
11
+ title : { control : ' text' },
11
12
dark : { control : ' boolean' },
12
- logoUrl : { control : ' text' },
13
- showSlotInNewRowOnMobile : { control : ' boolean' },
13
+ logo : { control : ' text' },
14
+ mobilenewlineslot : { control : ' boolean' },
14
15
}}
15
16
/>
16
17
25
26
<Story
26
27
name =" With Title"
27
28
args ={{
28
- titleText : ' CIVIL MOVEMENT 2020' ,
29
+ title : ' CIVIL MOVEMENT 2020' ,
29
30
}}
30
31
/>
31
32
32
33
<Story
33
34
name =" Custom Logo"
34
35
args ={{
35
- logoUrl : ' https://via.placeholder.com/100x20' ,
36
+ logo : ' https://via.placeholder.com/100x20' ,
36
37
}}
37
38
/>
Original file line number Diff line number Diff line change 1
1
<svelte:options tag =" elect-navbar" />
2
2
3
3
<script lang =" ts" >
4
- export let titleText : string = ' ' ;
4
+ export let title : string = ' ' ;
5
5
export let dark: boolean = false ;
6
- export let logoUrl: string = ' ' ;
7
- export let showSlotInNewRowOnMobile: boolean = false ;
6
+ export let logo: string = ' ' ;
7
+ export let mobilenewlineslot: boolean = false ;
8
+
8
9
</script >
9
10
10
11
<div
11
- class ="flex bg-white { showSlotInNewRowOnMobile
12
- ? ' flex-col md:flex-row '
12
+ class ="flex bg-white md:flex-row { mobilenewlineslot
13
+ ? ' flex-col'
13
14
: ' flex-row' } {dark ? ' bg-black' : ' bg-white' }"
14
15
>
15
16
<div class =" flex my-auto p-3 h-10 md:(flex-1 h-12)" >
16
17
<a href =" ./" class =" h-4 md:h-5 my-auto" >
17
- {#if logoUrl }
18
- <img src ={logoUrl } alt =" ELECT" class =" h-4 md:h-5" />
18
+ {#if logo }
19
+ <img src ={logo } alt =" ELECT" class =" h-4 md:h-5" />
19
20
{:else }
20
21
<svg
21
22
class ="h-4 md:h-5 {dark ? ' text-white' : ' text-black' }"
55
56
{/if }
56
57
</a >
57
58
</div >
58
- {#if titleText }
59
+ {#if title }
59
60
<div class =" hidden md:flex" >
60
61
<a href =" ./" class =" my-auto flex font-heading text-lg md:text-xl" >
61
- <span class ={dark ? ' text-white' : ' text-black' }>{titleText }</span >
62
+ <span class ={dark ? ' text-white' : ' text-black' }>{title }</span >
62
63
</a >
63
64
</div >
64
65
{/if }
65
66
66
67
<div
67
- class ="flex-1 flex {showSlotInNewRowOnMobile
68
+ class ="flex-1 flex {mobilenewlineslot
68
69
? ' md:(justify-end pr-3)'
69
70
: ' justify-end pr-3' }"
70
71
>
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import { Meta , Template , Story } from ' @storybook/addon-svelte-csf' ;
3
3
import SocialSharer from ' ./sharer.wc.svelte' ;
4
+
4
5
</script >
5
6
6
7
<Meta
9
10
argTypes ={{
10
11
url : { control : ' text' },
11
12
light : { control : ' boolean' },
12
- hideLabel : { control : ' boolean' },
13
+ hidelabel : { control : ' boolean' },
13
14
vertical : { control : ' boolean' },
14
15
}}
15
16
/>
Original file line number Diff line number Diff line change 3
3
<script lang =" ts" >
4
4
export let url: string = ' ' ;
5
5
export let light: boolean = false ;
6
- export let hideLabel : boolean = false ;
6
+ export let hidelabel : boolean = false ;
7
7
export let vertical: boolean = false ;
8
8
9
9
$ : encodedUrl = encodeURI (url || window .location .href );
58
58
` ,
59
59
},
60
60
];
61
+
61
62
</script >
62
63
63
64
<div
66
67
: ' flex-row space-x-4' }"
67
68
class:text-white ={light }
68
69
>
69
- {#if ! hideLabel }
70
+ {#if ! hidelabel }
70
71
<div class =" flex text-sm" >
71
72
<span class:m-auto ={! vertical }>Share</span >
72
73
</div >
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import { Meta , Template , Story } from ' @storybook/addon-svelte-csf' ;
3
3
import StagingBanner from ' ./staging-banner.wc.svelte' ;
4
+
4
5
</script >
5
6
6
7
<Meta
7
8
title =" Components/staging-banner"
8
9
component ={StagingBanner }
9
10
argTypes ={{
10
- productionUrl : { control : ' text' },
11
+ productionurl : { control : ' text' },
11
12
}}
12
13
/>
13
14
18
19
<Story
19
20
name =" Primary"
20
21
args ={{
21
- productionUrl : ' ' ,
22
+ productionurl : ' ' ,
22
23
}}
23
24
/>
Original file line number Diff line number Diff line change 1
1
<svelte:options tag =" elect-staging-banner" />
2
2
3
3
<script lang =" ts" >
4
- let productionUrl: string = ' ' ;
4
+ let productionurl: string = ' ' ;
5
+
5
6
</script >
6
7
7
8
<div class =" bg-gray-600 text-white text-xs font-body px-4 py-2" >
26
27
<strong >คำเตือน</strong >
27
28
เว็บไซต์นี้มีจุดประสงค์ในการทดสอบภายในทีม ELECT เท่านั้น อาจมีข้อมูลและการทำงานที่ไม่ถูกต้อง
28
29
ทางทีมงานจะไม่รับผิดชอบข้อผิดพลาดใด ๆ ที่เกิดขึ้น
29
- {#if productionUrl }
30
+ {#if productionurl }
30
31
ท่านสามารถชมชิ้นงานจริงได้
31
32
<a
32
- href ="$ {productionUrl }"
33
+ href ="$ {productionurl }"
33
34
target =" _blank"
34
35
rel =" noopener noreferrer"
35
36
class =" underline"
You can’t perform that action at this time.
0 commit comments