Skip to content

Commit 9873b12

Browse files
committed
hide filter in assets
1 parent 21145ff commit 9873b12

File tree

2 files changed

+41
-43
lines changed

2 files changed

+41
-43
lines changed

client/modules/IDE/hooks/useWhatPage.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { useLocation } from 'react-router-dom';
77
* @returns {"home" | "myStuff" | "login" | "signup" | "account" | "examples"}
88
*/
99
const useWhatPage = () => {
10-
const projectName = useSelector((state) => state.project.name);
1110
const username = useSelector((state) => state.user.username);
1211
const { pathname } = useLocation();
1312

client/modules/User/components/DashboardTabSwitcher.jsx

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ Tab.propTypes = {
4040

4141
// It is good for right now, because we need to separate the nav dropdown logic from the navBar before we can use it here
4242
const FilterOptions = styled(Options)`
43-
&.hidden {
44-
display: none;
45-
}
46-
4743
> div > button:focus + ul,
4844
> div > ul > button:focus ~ div > ul {
4945
transform: scale(1);
@@ -80,51 +76,54 @@ const DashboardTabSwitcher = ({ currentTab, isOwner, username }) => {
8076
)}
8177
</div>
8278
<MediaQuery maxWidth={770}>
83-
{(mobile) => (
84-
<FilterOptions className={mobile ? 'visible' : 'hidden'}>
85-
<div>
86-
<IconButton icon={FilterIcon} />
87-
<ul>
88-
<li>
89-
<button
90-
onClick={() => dispatch(toggleDirectionForField('name'))}
91-
>
92-
{t('CollectionList.HeaderName')}
93-
</button>
94-
</li>
95-
<li>
96-
<button
97-
onClick={() =>
98-
dispatch(toggleDirectionForField('createdAt'))
99-
}
100-
>
101-
{t('CollectionList.HeaderCreatedAt')}
102-
</button>
103-
</li>
104-
<li>
105-
<button
106-
onClick={() =>
107-
dispatch(toggleDirectionForField('updatedAt'))
108-
}
109-
>
110-
{t('CollectionList.HeaderUpdatedAt')}
111-
</button>
112-
</li>
113-
{currentTab === TabKey.collections && (
79+
{(mobile) =>
80+
mobile &&
81+
currentTab !== TabKey.assets && (
82+
<FilterOptions>
83+
<div>
84+
<IconButton icon={FilterIcon} />
85+
<ul>
86+
<li>
87+
<button
88+
onClick={() => dispatch(toggleDirectionForField('name'))}
89+
>
90+
{t('CollectionList.HeaderName')}
91+
</button>
92+
</li>
11493
<li>
11594
<button
11695
onClick={() =>
117-
dispatch(toggleDirectionForField('numItems'))
96+
dispatch(toggleDirectionForField('createdAt'))
11897
}
11998
>
120-
# of sketches
99+
{t('CollectionList.HeaderCreatedAt')}
121100
</button>
122101
</li>
123-
)}
124-
</ul>
125-
</div>
126-
</FilterOptions>
127-
)}
102+
<li>
103+
<button
104+
onClick={() =>
105+
dispatch(toggleDirectionForField('updatedAt'))
106+
}
107+
>
108+
{t('CollectionList.HeaderUpdatedAt')}
109+
</button>
110+
</li>
111+
{currentTab === TabKey.collections && (
112+
<li>
113+
<button
114+
onClick={() =>
115+
dispatch(toggleDirectionForField('numItems'))
116+
}
117+
>
118+
# of sketches
119+
</button>
120+
</li>
121+
)}
122+
</ul>
123+
</div>
124+
</FilterOptions>
125+
)
126+
}
128127
</MediaQuery>
129128
</ul>
130129
);

0 commit comments

Comments
 (0)