-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mobile categories + routes #456
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Something is wrong either with my browser or with github - it doesn't want to submit reviews)
app/routes/tags.$.tsx
Outdated
@@ -29,16 +30,18 @@ export default function Tags() { | |||
if (selectedTag === null) { | |||
return null | |||
} | |||
const isTagsPage = window.location.pathname.split('/').slice(-2)[0] === 'tags' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this. It would be much better to have a button of some kind that shows a modal with all the tags, rather than having to mess about with urls. It sort of makes sense but would be annoying to have to go through an extra menu each time you wanted to choose a different category.
@melissasamworth are you sure you want it to work this way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you'll have to change the loader, which is in tags.all.tsx
. Currently it chooses the first tag if none is specified - change it to:
- if not tag chosen, return currentTag as undefined
- if tag chosen and found, return it as currentTag
- if tag chosen and not found, raise a 404
Then you can only show the article
if selectedTag !== undefined
and won't have to check the url. There will be some extra css changes for the desktop version, but that will require a design so is out of scope here
app/routes/tags.$.tsx
Outdated
/> | ||
|
||
{selectedTag === null ? null : ( | ||
{mobile && !isTagsPage ? null : ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also do a className={isTagsPage ? '' : 'desktop-only'}
which will hide this component on mobile if it's not the navigation view
@@ -19,7 +19,7 @@ interface CategoriesNavProps { | |||
export const CategoriesNav = ({categories, activeCategoryId}: CategoriesNavProps) => { | |||
const [search, onSearch] = useState('') | |||
return ( | |||
<div className={styles.categoriesGroup + ' bordered col-4-5'}> | |||
<div className={'categoriesGroup bordered col-4-5'}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a specific reason for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, cannot use @media .Class1.Class2
with modules. only @media .Class1
width: 100%; | ||
height: 100%; | ||
} | ||
.categoriesGroup.bordered { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there ever a categoriesGroup without the bordered class?
No description provided.