mirror of
https://github.com/wassname/talk.git
synced 2026-08-11 11:27:10 +08:00
* feat: extract jwt information * feat: login status dependent auto redirect * feat: Sign Out button * feat: add a 404 page * feat: improve loading state and use auth token info * feat: redirect to previous destination * feat: implement new design * fix: change asset to story * feat: add translations * feat: more compact design * test: add unit tests * chore: refactor NavigationLink * test: add integration tests * chore: refactor replaceHistoryLocation * fix: typo * fix: property name typo
38 lines
1001 B
TypeScript
38 lines
1001 B
TypeScript
import { Localized } from "fluent-react/compat";
|
|
import * as React from "react";
|
|
import { StatelessComponent } from "react";
|
|
import { 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;
|
|
}
|
|
|
|
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>
|
|
)}
|
|
</TabBar>
|
|
);
|
|
};
|
|
|
|
export default AppTabBar;
|