-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #485 from audioverse-org/AV-615-Logged-User-to-see…
…-Discover-Section-upon-accessing-website-currently-shows-Home-Page Av 615 logged user to see discover section upon accessing website currently shows home page
- Loading branch information
Showing
9 changed files
with
89 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/components/organisms/cardSlider/section/topicsBrowse.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
query getSectionTopicsBrowse( | ||
$language: Language! | ||
$first: Int! = 6 | ||
$after: String = null | ||
) { | ||
topics( | ||
language: $language | ||
first: $first | ||
after: $after | ||
orderBy: { field: FEATURED, direction: DESC } | ||
) { | ||
nodes { | ||
...cardTopic | ||
} | ||
pageInfo { | ||
hasNextPage | ||
endCursor | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/components/organisms/cardSlider/section/topicsBrowse.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import { useIntl } from 'react-intl'; | ||
|
||
import { CardTopicFragment } from '~src/components/molecules/card/__generated__/topic'; | ||
import CardTopic from '~src/components/molecules/card/topic'; | ||
import root from '~src/lib/routes'; | ||
import { useLanguageId } from '~src/lib/useLanguageId'; | ||
|
||
import { useInfiniteGetSectionTopicsBrowseQuery } from './__generated__/topicsBrowse'; | ||
import Section from './index'; | ||
|
||
export default function TopicsBrowse(): JSX.Element { | ||
const intl = useIntl(); | ||
const language = useLanguageId(); | ||
return ( | ||
<Section | ||
infiniteQuery={useInfiniteGetSectionTopicsBrowseQuery} | ||
heading={intl.formatMessage({ | ||
id: 'browse_topicsHeading', | ||
defaultMessage: 'Topics', | ||
})} | ||
previous={intl.formatMessage({ | ||
id: 'browse__topicsPrevious', | ||
defaultMessage: 'Previous topics', | ||
})} | ||
next={intl.formatMessage({ | ||
id: 'browse__topicsNext', | ||
defaultMessage: 'Next topics', | ||
})} | ||
seeAllUrl={root.lang(language).topics.get()} | ||
Card={(p: { node: CardTopicFragment }) => <CardTopic topic={p.node} />} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f10640f
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.
Successfully deployed to the following URLs:
audioverse-next – ./
audioverse-next-git-master-audioverse.vercel.app
audioverse-next.vercel.app
audioverse.org
audioverse-next-audioverse.vercel.app
beta.audioverse.org
www.audioverse.org