mirror of
https://github.com/wassname/talk.git
synced 2026-07-27 11:28:12 +08:00
* feat: Implement stream configuration tab * feat: split profile & configure into separate bundles * chore: better role logic * fix+chore: add test cases, implement expectAndFail, refactor tests * chore: add some comments * chore: Update src/core/client/framework/lib/form/helpers.tsx Co-Authored-By: cvle <vinh@wikiwi.io> * feat: support new graphql mutations/schema * fix: ci fixes * fix: improvement to revision loading * fix: updated some tests * fix: adapt client to changes * fix: remove obsolote isClosed in UpdateStory * ci: increase no_output_timeout for build
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
import { Localized } from "fluent-react/compat";
|
|
import * as React from "react";
|
|
import { StatelessComponent } from "react";
|
|
import { Icon, MatchMedia, Tab, TabBar } from "talk-ui/components";
|
|
|
|
type TabValue = "COMMENTS" | "PROFILE" | "%future added value";
|
|
|
|
export interface Props {
|
|
activeTab: TabValue;
|
|
onTabClick: (tab: TabValue) => void;
|
|
commentCount: number;
|
|
showProfileTab: boolean;
|
|
showConfigureTab: boolean;
|
|
}
|
|
|
|
const AppTabBar: StatelessComponent<Props> = props => {
|
|
return (
|
|
<TabBar activeTab={props.activeTab} onTabClick={props.onTabClick}>
|
|
<Tab tabId="COMMENTS">
|
|
<Localized
|
|
id="general-tabBar-commentsTab"
|
|
$commentCount={props.commentCount}
|
|
>
|
|
<span>{"{$commentCount} Comments"}</span>
|
|
</Localized>
|
|
</Tab>
|
|
{props.showProfileTab && (
|
|
<Tab tabId="PROFILE">
|
|
<Localized id="general-tabBar-myProfileTab">
|
|
<span>My Profile</span>
|
|
</Localized>
|
|
</Tab>
|
|
)}
|
|
{props.showConfigureTab && (
|
|
<Tab tabId="CONFIGURE">
|
|
<MatchMedia gteWidth="sm">
|
|
{matches =>
|
|
matches ? (
|
|
<Localized id="general-tabBar-configure">
|
|
<span>Configure</span>
|
|
</Localized>
|
|
) : (
|
|
<Icon aria-label="Configure">settings</Icon>
|
|
)
|
|
}
|
|
</MatchMedia>
|
|
</Tab>
|
|
)}
|
|
</TabBar>
|
|
);
|
|
};
|
|
|
|
export default AppTabBar;
|