@@ -2,38 +2,42 @@ import React from "react";
2
2
import styled , { css } from "styled-components" ;
3
3
4
4
import { useToggle } from "react-use" ;
5
+ import { useParams } from "react-router-dom" ;
5
6
6
7
import { landscapeStyle } from "styles/landscapeStyle" ;
7
8
import { responsiveSize } from "styles/responsiveSize" ;
8
9
9
10
import RankingIcon from "svgs/icons/ranking.svg" ;
10
11
12
+ import { decodeURIFilter } from "utils/uri" ;
13
+
11
14
import HowItWorks from "components/HowItWorks" ;
12
15
import JurorLevels from "components/Popup/MiniGuides/JurorLevels" ;
13
16
14
17
import Coherence from "./Coherence" ;
15
18
import Rewards from "./Rewards" ;
16
19
17
- const Container = styled . div `
20
+ const Container = styled . div < { renderIcon ?: boolean } > `
18
21
display: none;
19
22
width: 100%;
20
23
background-color: ${ ( { theme } ) => theme . lightBlue } ;
21
- border 1px solid ${ ( { theme } ) => theme . stroke } ;
24
+ border: 1px solid ${ ( { theme } ) => theme . stroke } ;
22
25
border-top-left-radius: 3px;
23
26
border-top-right-radius: 3px;
24
27
border-bottom: 1px solid ${ ( { theme } ) => theme . stroke } ;
25
28
padding: 18.6px 32px;
26
29
27
- ${ landscapeStyle (
28
- ( ) => css `
29
- display: grid;
30
- grid-template-columns:
31
- min-content repeat(3, ${ responsiveSize ( 160 , 180 , 900 ) } )
32
- auto;
33
- column-gap: ${ responsiveSize ( 12 , 28 , 900 ) } ;
34
- align-items: center;
35
- `
36
- ) }
30
+ ${ ( { renderIcon } ) =>
31
+ landscapeStyle (
32
+ ( ) => css `
33
+ display: grid;
34
+ grid-template-columns: ${ renderIcon
35
+ ? `min-content repeat(3, ${ responsiveSize ( 160 , 180 , 900 ) } ) auto`
36
+ : `repeat(3, ${ responsiveSize ( 160 , 180 , 900 ) } ) auto` } ;
37
+ column-gap: ${ responsiveSize ( 12 , 28 , 900 ) } ;
38
+ align-items: center;
39
+ `
40
+ ) }
37
41
` ;
38
42
39
43
const StyledRankingIcon = styled ( RankingIcon ) `
@@ -53,10 +57,13 @@ const HowItWorksContainer = styled.div`
53
57
54
58
export const DesktopHeader : React . FC = ( ) => {
55
59
const [ isJurorLevelsMiniGuideOpen , toggleJurorLevelsMiniGuide ] = useToggle ( false ) ;
60
+ const { filter } = useParams ( ) ;
61
+ const { id : searchValue } = decodeURIFilter ( filter ?? "all" ) ;
62
+ const renderIcon = ! searchValue ;
56
63
57
64
return (
58
- < Container >
59
- < StyledRankingIcon />
65
+ < Container renderIcon = { renderIcon } >
66
+ { renderIcon ? < StyledRankingIcon /> : null }
60
67
< StyledLabel > Juror</ StyledLabel >
61
68
< Rewards />
62
69
< Coherence />
0 commit comments