File tree Expand file tree Collapse file tree 4 files changed +69
-15
lines changed Expand file tree Collapse file tree 4 files changed +69
-15
lines changed Original file line number Diff line number Diff line change 1
1
import "./App.css" ;
2
2
import { MSWDevTool } from "@msw-dev-tool/react" ;
3
- import "@msw-dev-tool/react/msw-dev-tool.css" ;
4
3
import { useMsw } from "./hooks/useMsw" ;
5
4
import { UserList } from "./components/UserList" ;
6
5
import { UserInfo } from "./components/UserInfo" ;
Original file line number Diff line number Diff line change 1
1
.msw-dt-default-trigger {
2
- background-color : rgb (234 88 12 );
3
- border-radius : 0.5rem ;
4
- padding : 0.5rem ;
5
- color : white;
6
- margin : 1rem ;
7
2
position : fixed;
8
- bottom : 0 ;
9
- left : 0 ;
3
+ bottom : 1.5 rem ;
4
+ left : 1.5 rem ;
10
5
z-index : 9999 ;
11
6
cursor : pointer;
12
7
display : flex;
13
- gap : 0.5 rem ;
8
+ justify-content : center ;
14
9
align-items : center;
10
+ padding : 0 ;
11
+ border : none;
12
+ background-color : transparent;
13
+ outline : none;
14
+ box-shadow : none;
15
+ margin : 0 ;
16
+ appearance : none;
17
+ user-select : none;
18
+ -webkit-tap-highlight-color : transparent;
15
19
}
16
20
17
- .msw-dt-default-trigger : hover {
18
- background-color : rgb (249 115 22 );
21
+ .msw-dt-default-trigger svg {
22
+ border : 1px solid # c7c7c7 ;
23
+ border-radius : 1rem ;
24
+ color : # 101010 ;
19
25
}
26
+
27
+ .msw-dt-default-trigger svg : hover {
28
+ color : # 202020 ;
29
+ }
30
+
Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+
3
+ export const MSWDevToolLogo = ( {
4
+ size = "28" ,
5
+ backgroundColor = "#101010" ,
6
+ color = "#FF6600" ,
7
+ className,
8
+ } : {
9
+ size ?: string | number ;
10
+ backgroundColor ?: string ;
11
+ color ?: string ;
12
+ className ?: string ;
13
+ } ) => {
14
+ return (
15
+ < svg
16
+ width = { size }
17
+ height = { size }
18
+ viewBox = "0 0 28 28"
19
+ fill = "none"
20
+ xmlns = "http://www.w3.org/2000/svg"
21
+ className = { className }
22
+ >
23
+ < rect
24
+ width = "28"
25
+ height = "28"
26
+ rx = "5"
27
+ fill = { backgroundColor }
28
+ />
29
+ < rect
30
+ width = "24"
31
+ height = "24"
32
+ transform = "translate(2 2)"
33
+ fill = { backgroundColor }
34
+ />
35
+ < path
36
+ d = "M24 10C24 13.3135 21.3135 16 18 16C16.9865 16 16.032 15.7485 15.195 15.305L6.5 24L4 21.5L12.695 12.805C12.2373 11.941 11.9987 10.9778 12 10C12 6.6865 14.6865 4 18 4C19.0135 4 19.968 4.251 20.805 4.695L17 8.5L19.5 11L23.305 7.195C23.7627 8.05905 24.0013 9.02222 24 10Z"
37
+ fill = { color }
38
+ stroke = { color }
39
+ strokeWidth = "0.5"
40
+ strokeLinecap = "round"
41
+ strokeLinejoin = "round"
42
+ />
43
+ </ svg >
44
+ ) ;
45
+ } ;
Original file line number Diff line number Diff line change 1
1
import React , { ComponentProps , forwardRef } from "react" ;
2
- import { CodeIcon } from "@radix-ui/react-icons" ;
3
2
import styles from "../style/trigger.css" ;
3
+ import { MSWDevToolLogo } from "./Components/Logo" ;
4
4
5
5
export const DefaultDevToolTrigger = forwardRef <
6
6
HTMLButtonElement ,
7
7
ComponentProps < "button" >
8
8
> ( ( props , ref ) => {
9
9
return (
10
10
< >
11
- < button ref = { ref } className = "msw-dt-default-trigger" { ...props } >
12
- < CodeIcon width = { "1rem" } height = { "1rem" } />
13
- msw
11
+ < button ref = { ref } className = "msw-dt-default-trigger" name = "msw-dev-tool trigger" { ...props } >
12
+ < MSWDevToolLogo size = { "3rem" } backgroundColor = "currentColor" />
14
13
</ button >
15
14
< style type = "text/css" > { styles } </ style >
16
15
</ >
You can’t perform that action at this time.
0 commit comments