Skip to content

Commit

Permalink
Pass platform into client, using platform to conditionally display Fe…
Browse files Browse the repository at this point in the history
…ast search UI
  • Loading branch information
jonathonherbert committed Apr 25, 2024
1 parent 6904671 commit 621722f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fronts-client/src/components/FeedSection.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React from 'react';
import { styled, theme } from 'constants/theme';

import { selectors as editionsIssueSelectors } from '../bundles/editionsIssueBundle';
import SectionContent from './layout/SectionContent';
import FeedContainer from './FeedsContainer';
import Clipboard from './Clipboard';
import FeedSectionHeader from './FeedSectionHeader';
import { media } from 'util/mediaQueries';
import { connect } from 'react-redux';
import { isMode } from 'selectors/pathSelectors';
import { State } from 'types/State';
import { FeastSearchContainer } from './feast/FeastSearchContainer';

interface Props {
isClipboardOpen: boolean;
isEditions: boolean;
isFeast: boolean;
}

const FeedSectionContainer = styled.div`
Expand All @@ -32,20 +32,20 @@ const FeedWrapper = styled.div<{ isClipboardOpen: boolean }>`
isClipboardOpen ? `solid 1px ${theme.base.colors.borderColor}` : null};
`;

const FeedSection = ({ isClipboardOpen, isEditions }: Props) => (
const FeedSection = ({ isClipboardOpen, isFeast }: Props) => (
<FeedSectionContainer>
<FeedSectionHeader />
<FeedSectionContent>
<FeedWrapper isClipboardOpen={isClipboardOpen}>
{isEditions ? <FeastSearchContainer /> : <FeedContainer />}
{isFeast ? <FeastSearchContainer /> : <FeedContainer />}
</FeedWrapper>
<Clipboard />
</FeedSectionContent>
</FeedSectionContainer>
);

const mapStateToProps = (state: State) => ({
isEditions: isMode(state, 'editions'),
isFeast: editionsIssueSelectors.selectAll(state)?.platform === 'feast',
});

export default connect(mapStateToProps)(FeedSection);
1 change: 1 addition & 0 deletions fronts-client/src/types/Edition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ interface EditionsIssue {
launchedEmail: string;
fronts: EditionsFront[];
lastProofedVersion?: string;
platform: string;
}

const issueVersionStatus = [
Expand Down

0 comments on commit 621722f

Please sign in to comment.