Skip to content

Commit

Permalink
Reflect comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbyul-here committed Oct 8, 2024
1 parent b13ccfa commit 4a0eaff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/scripts/components/stories/hub/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SmartLink from '$components/common/smart-link';

const allStories = Object.values(stories).map((d) => d!.data).filter(d => !d.isHidden).map((d) => ({ ...d, path: getStoryPath(d)}));

function StoriesHub() {
function StoriesHubContainer() {
const controlVars = useFiltersWithQS({navigate: useNavigate()});
return (
<PageMainContent>
Expand All @@ -41,12 +41,12 @@ function StoriesHub() {
allStories={allStories}
onFilterchanges={() => controlVars}
linkProperties={{ LinkElement: SmartLink, pathAttributeKeyName: 'to'}}
storiesPagePath={STORIES_PATH}
pathname={STORIES_PATH}
storiesString={{one: getString('stories').one,other: getString('stories').other}}
/>
</ContentOverride>
</PageMainContent>
);
}

export default StoriesHub;
export default StoriesHubContainer;
10 changes: 5 additions & 5 deletions app/scripts/components/stories/hub/hub-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ interface StoryDataWithPath extends StoryData {path: string}
interface HubContentProps {
allStories: StoryDataWithPath[];
linkProperties: LinkProperties;
storiesPagePath: string;
pathname: string;
storiesString: {one: string, other: string};
onFilterchanges: () => UseFiltersWithQueryResult;
}

export default function HubContent(props:HubContentProps) {
const { allStories, linkProperties, storiesPagePath, storiesString, onFilterchanges } = props;
const { allStories, linkProperties, pathname, storiesString, onFilterchanges } = props;
const browseControlsHeaderRef = useRef<HTMLDivElement>(null);
const { headerHeight } = useSlidingStickyHeaderProps();
const { search, taxonomies, onAction } = onFilterchanges();
Expand All @@ -74,13 +74,13 @@ export default function HubContent(props:HubContentProps) {

const ButtonLinkProps = {
forwardedAs: LinkElement,
[pathAttributeKeyName]: storiesPagePath
[pathAttributeKeyName]: pathname
};

function getPillLinkProps(t){
return {
as: LinkElement,
[pathAttributeKeyName]: `${storiesPagePath}?${FilterActions.TAXONOMY}=${encodeURIComponent(JSON.stringify({ Topics: t.id }))}`
[pathAttributeKeyName]: `${pathname}?${FilterActions.TAXONOMY}=${encodeURIComponent(JSON.stringify({ Topics: t.id }))}`
};
}
const displayStories = useMemo(
Expand Down Expand Up @@ -148,7 +148,7 @@ export default function HubContent(props:HubContentProps) {
<CardMeta>
<CardSourcesList
sources={getTaxonomy(d, TAXONOMY_SOURCE)?.values}
rootPath={storiesPagePath}
rootPath={pathname}
onSourceClick={(id) => {
onAction(FilterActions.TAXONOMY_MULTISELECT, {
key: TAXONOMY_SOURCE,
Expand Down

0 comments on commit 4a0eaff

Please sign in to comment.