You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
767 B
TypeScript
43 lines
767 B
TypeScript
import classNames from 'classnames';
|
|
import React from 'react';
|
|
import { SignUpMode, SignUpTab } from './SignUpTab';
|
|
|
|
export enum TabType {
|
|
SignUp,
|
|
SignIn,
|
|
}
|
|
|
|
export const TabLabel = ({
|
|
isSelected,
|
|
onSelect,
|
|
type,
|
|
}: {
|
|
isSelected: boolean;
|
|
onSelect?: (event: TabType) => void;
|
|
type: TabType;
|
|
}) => {
|
|
const handleClick = onSelect
|
|
? () => {
|
|
onSelect(type);
|
|
}
|
|
: undefined;
|
|
|
|
const label =
|
|
type === TabType.SignUp
|
|
? window.i18n('createAccount')
|
|
: window.i18n('signIn');
|
|
|
|
return (
|
|
<div
|
|
className={classNames(
|
|
'session-registration__tab',
|
|
isSelected ? 'session-registration__tab--active' : null
|
|
)}
|
|
onClick={handleClick}
|
|
role="tab"
|
|
>
|
|
{label}
|
|
</div>
|
|
);
|
|
};
|