Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
describe('discovery page: ', () => {
describe('explore page: ', () => {
// beforeEach(() => {
before(() => {
cy.visit('/discovery')
cy.visit('/explore')
})

it('basic layout', () => {
Expand All @@ -13,13 +13,13 @@ describe('discovery page: ', () => {

// cy.id('sidebar').should('be.visible')

cy.id('discovery-banner').should('be.visible')
cy.id('explore-banner').should('be.visible')
// cypress can not load dynamic Footer
// cy.id('footer').should('be.visible')
})

it('discovery link should be highlight', () => {
cy.id('header-discovery-link')
cy.id('header-explore-link')
.should('not.have.css', 'background', 'transparent')
.and('have.css', 'padding', '5px 6px')
})
Expand Down
6 changes: 3 additions & 3 deletions server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ router.route('/create/works').get((req, res) => {
})

// 所有社区
router.route('/discovery').get((req, res) => res.redirect('/discovery/pl'))
router.route('/explore').get((req, res) => res.redirect('/explore/pl'))

router.route('/discovery/:category').get((req, res) => {
return renderAndCache({ req, res, path: '/discovery' })
router.route('/explore/:category').get((req, res) => {
return renderAndCache({ req, res, path: '/explore' })
})

// 帮助中心
Expand Down
2 changes: 1 addition & 1 deletion size-limit.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"maxSize": "280 kB"
},
{
"path": ".next/server/pages/discovery.js",
"path": ".next/server/pages/explore.js",
"maxSize": "280 kB"
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/DesktopView/CommunityLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AddOns = dynamic(() => import('../AddOns'), { ssr: false })

const hasNoBorder = (metric: TMetric): boolean =>
contains(metric, [
METRIC.DISCOVERY,
METRIC.EXPLORE,
METRIC.SPONSOR,
METRIC.SUPPORT_US,
METRIC.SUBSCRIBE,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/DesktopView/GeneralLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AddOns = dynamic(() => import('../AddOns'), { ssr: false })

const hasNoBorder = (metric: TMetric): boolean =>
contains(metric, [
METRIC.DISCOVERY,
METRIC.EXPLORE,
METRIC.SPONSOR,
METRIC.SUPPORT_US,
METRIC.SUBSCRIBE,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/DesktopView/WorksLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AddOns = dynamic(() => import('../AddOns'), { ssr: false })

const hasNoBorder = (metric: TMetric): boolean =>
contains(metric, [
METRIC.DISCOVERY,
METRIC.EXPLORE,
METRIC.SPONSOR,
METRIC.SUPPORT_US,
METRIC.SUBSCRIBE,
Expand Down
6 changes: 3 additions & 3 deletions src/components/Navigator/MainEntries/DesktopView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ const DesktopView: FC<TProps> = ({ type }) => {

return (
<Wrapper type={type}>
<Link href={`/${ROUTE.DISCOVERY}`} passHref>
<Link href={`/${ROUTE.EXPLORE}`} passHref>
<SiteLink
active={mainPath === ROUTE.DISCOVERY}
testid="header-discovery-link"
active={mainPath === ROUTE.EXPLORE}
testid="header-explore-link"
>
发现
</SiteLink>
Expand Down
10 changes: 5 additions & 5 deletions src/components/Navigator/MorePanel/MobileView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,35 @@ const items = [
icon: `${ICON}/route/light.svg`,
title: '作品集市',
desc: '作品,产品的跳蚤集市',
href: `/${ROUTE.DISCOVERY}`,
href: `/${ROUTE.EXPLORE}`,
raw: 11,
},
{
icon: `${ICON}/route/cool-guide.svg`,
title: '酷导航',
desc: '发现有意思的东西',
href: `/${ROUTE.DISCOVERY}`,
href: `/${ROUTE.EXPLORE}`,
raw: 12,
},
{
icon: `${ICON}/route/job.svg`,
title: '工作',
desc: '找工作?来这里看看',
href: `/${ROUTE.DISCOVERY}`,
href: `/${ROUTE.EXPLORE}`,
raw: 13,
},
{
icon: `${ICON}/route/cup.svg`,
title: '来一杯',
desc: '渴了累了来一杯?',
href: `/${ROUTE.DISCOVERY}`,
href: `/${ROUTE.EXPLORE}`,
raw: 14,
},
{
icon: `${ICON}/route/meetup.svg`,
title: '活动',
desc: '来线下和同行聊聊?',
href: `/${ROUTE.DISCOVERY}`,
href: `/${ROUTE.EXPLORE}`,
raw: 15,
},
{
Expand Down
10 changes: 5 additions & 5 deletions src/containers/content/CommunitiesContent/store.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* DiscoveryContentStore store
* ExploreContentStore store
*
*/

Expand All @@ -11,7 +11,7 @@ import { markStates, toJS } from '@/utils/mobx'
import { Trans } from '@/utils/i18n'
import { PagedCommunities, PagedCategories, emptyPagiData } from '@/model'

const DiscoveryContentStore = T.model('DiscoveryContentStore', {
const ExploreContentStore = T.model('ExploreContentStore', {
// current active sidbar menu id
activeCatalogId: T.maybeNull(T.string),
pagedCommunities: T.optional(PagedCommunities, emptyPagiData),
Expand Down Expand Up @@ -121,11 +121,11 @@ const DiscoveryContentStore = T.model('DiscoveryContentStore', {
},
addSubscribedCommunity(community) {
self.root.account.addSubscribedCommunity(community)
self.root.discoveryContent.toggleSubscribe(community)
self.root.exploreContent.toggleSubscribe(community)
},
removeSubscribedCommunity(community) {
self.root.account.removeSubscribedCommunity(community)
self.root.discoveryContent.toggleSubscribe(community)
self.root.exploreContent.toggleSubscribe(community)
},
markRoute(query) {
self.root.markRoute(query)
Expand All @@ -135,4 +135,4 @@ const DiscoveryContentStore = T.model('DiscoveryContentStore', {
},
}))

export default DiscoveryContentStore
export default ExploreContentStore
51 changes: 0 additions & 51 deletions src/containers/content/DiscoveryContent/CommunityCard.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/containers/content/DiscoveryContent/CommunityList.js

This file was deleted.

13 changes: 0 additions & 13 deletions src/containers/content/DiscoveryContent/Hinter.js

This file was deleted.

89 changes: 0 additions & 89 deletions src/containers/content/DiscoveryContent/SubscribeBtn.js

This file was deleted.

10 changes: 0 additions & 10 deletions src/containers/content/DiscoveryContent/tests/store.test.ts

This file was deleted.

Loading