mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Change prettier rules
This commit is contained in:
@@ -4,36 +4,32 @@ import { FormattedMessage as Message, MessageDescriptor } from 'react-intl';
|
||||
import Context, { AuthContext } from './Context';
|
||||
|
||||
interface Props {
|
||||
isAvailable?: (context: AuthContext) => boolean;
|
||||
payload?: Record<string, any>;
|
||||
label: MessageDescriptor;
|
||||
isAvailable?: (context: AuthContext) => boolean;
|
||||
payload?: Record<string, any>;
|
||||
label: MessageDescriptor;
|
||||
}
|
||||
|
||||
const RejectionLink: ComponentType<Props> = ({
|
||||
isAvailable,
|
||||
payload,
|
||||
label,
|
||||
}) => {
|
||||
const context = useContext(Context);
|
||||
const RejectionLink: ComponentType<Props> = ({ isAvailable, payload, label }) => {
|
||||
const context = useContext(Context);
|
||||
|
||||
if (isAvailable && !isAvailable(context)) {
|
||||
// TODO: if want to properly support multiple links, we should control
|
||||
// the dividers ' | ' rendered from factory too
|
||||
return null;
|
||||
}
|
||||
if (isAvailable && !isAvailable(context)) {
|
||||
// TODO: if want to properly support multiple links, we should control
|
||||
// the dividers ' | ' rendered from factory too
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<a
|
||||
href="#"
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
return (
|
||||
<a
|
||||
href="#"
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
|
||||
context.reject(payload);
|
||||
}}
|
||||
>
|
||||
<Message {...label} />
|
||||
</a>
|
||||
);
|
||||
context.reject(payload);
|
||||
}}
|
||||
>
|
||||
<Message {...label} />
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
export default RejectionLink;
|
||||
|
||||
Reference in New Issue
Block a user