Files
talk/src/core/client/stream/components/TabBar.tsx
T
KiwiandGitHub 9eb5afbb2b [CORL-159, CORL-160] Stream Config Tab (#2219)
* 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
2019-03-18 22:07:52 +01:00

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;