File tree Expand file tree Collapse file tree 4 files changed +106
-0
lines changed
website/src/components/address-bar Expand file tree Collapse file tree 4 files changed +106
-0
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,38 @@ export default function AddressBar({ url, onUpdate }: AddressBarProps) {
2626 [ onUpdate ]
2727 ) ;
2828
29+ const handleRefresh = useCallback (
30+ function ( e : React . MouseEvent < HTMLButtonElement > ) {
31+ e . preventDefault ( ) ;
32+ if ( url ) {
33+ onUpdate ?.( url ) ;
34+ }
35+ } ,
36+ [ url , onUpdate ]
37+ ) ;
38+
2939 return (
3040 < form className = { css . form } onSubmit = { handleSubmit } >
41+ < button
42+ type = "button"
43+ className = { css . refreshButton }
44+ onClick = { handleRefresh }
45+ aria-label = "Refresh page"
46+ title = "Refresh page"
47+ >
48+ < svg
49+ width = "16"
50+ height = "16"
51+ viewBox = "0 0 16 16"
52+ fill = "none"
53+ xmlns = "http://www.w3.org/2000/svg"
54+ >
55+ < path
56+ d = "M13.65 2.35C12.2 0.9 10.21 0 8 0 3.58 0 0.01 3.58 0.01 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L9 7h7V0l-2.35 2.35z"
57+ fill = "currentColor"
58+ />
59+ </ svg >
60+ </ button >
3161 < div className = { css . inputContainer } >
3262 < input
3363 ref = { input }
Original file line number Diff line number Diff line change 22 position : relative;
33 display : flex;
44 transition : opacity 0.5s ease;
5+ align-items : center;
6+ gap : 8px ;
7+ }
8+
9+ .refresh-button {
10+ display : flex;
11+ align-items : center;
12+ justify-content : center;
13+ padding : 5px ;
14+ background : transparent;
15+ border : none;
16+ color : # b4becb ;
17+ cursor : pointer;
18+ transition : color 0.2s ease;
19+ flex-shrink : 0 ;
20+ }
21+
22+ .refresh-button : hover {
23+ color : # fff ;
24+ }
25+
26+ .refresh-button : active {
27+ transform : scale (0.95 );
528}
629
730.input-container {
Original file line number Diff line number Diff line change @@ -26,8 +26,38 @@ export default function AddressBar({ url, onUpdate }: AddressBarProps) {
2626 [ onUpdate ]
2727 ) ;
2828
29+ const handleRefresh = useCallback (
30+ function ( e : React . MouseEvent < HTMLButtonElement > ) {
31+ e . preventDefault ( ) ;
32+ if ( url ) {
33+ onUpdate ?.( url ) ;
34+ }
35+ } ,
36+ [ url , onUpdate ]
37+ ) ;
38+
2939 return (
3040 < form className = { css . form } onSubmit = { handleSubmit } >
41+ < button
42+ type = "button"
43+ className = { css . refreshButton }
44+ onClick = { handleRefresh }
45+ aria-label = "Refresh page"
46+ title = "Refresh page"
47+ >
48+ < svg
49+ width = "16"
50+ height = "16"
51+ viewBox = "0 0 16 16"
52+ fill = "none"
53+ xmlns = "http://www.w3.org/2000/svg"
54+ >
55+ < path
56+ d = "M13.65 2.35C12.2 0.9 10.21 0 8 0 3.58 0 0.01 3.58 0.01 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L9 7h7V0l-2.35 2.35z"
57+ fill = "currentColor"
58+ />
59+ </ svg >
60+ </ button >
3161 < div className = { css . inputContainer } >
3262 < input
3363 ref = { input }
Original file line number Diff line number Diff line change 33 display : flex;
44 transition : opacity 0.5s ease;
55 width : 100% ;
6+ align-items : center;
7+ gap : 8px ;
8+ }
9+
10+ .refresh-button {
11+ display : flex;
12+ align-items : center;
13+ justify-content : center;
14+ padding : 5px ;
15+ background : transparent;
16+ border : none;
17+ color : # b4becb ;
18+ cursor : pointer;
19+ transition : color 0.2s ease;
20+ flex-shrink : 0 ;
21+ }
22+
23+ .refresh-button : hover {
24+ color : # fff ;
25+ }
26+
27+ .refresh-button : active {
28+ transform : scale (0.95 );
629}
730
831.input-container {
You can’t perform that action at this time.
0 commit comments