reafctor: normalize component formatting (#2082)
* refactor: move/rename BanUserButton file * refactor: move/rename Chart file * refactor: update generic component filenames to PascalCase * refactor: update config component filenames to PascalCase * refactor: update AdminLayout component filename to PascalCase * refactor: update/move VideoJS component * chore(eslint): disable bad react/require-default-props rule * refactor: normalize ActionButton component * refactor: normalize ActionButtonRow component * refactor: normalize FollowButton component * refactor: normalize NotifyButton component * refactor: normalize ChatActionMessage component * refactor: normalize ChatContainer component * refactor: normalize ChatJoinMessage component * refactor: normalize ChatModerationActionMenu component * refactor: normalize ChatModerationDetailsModal component * refactor: normalize ChatModeratorNotification component * refactor: normalize ChatSocialMessage component * refactor: normalize ChatSystemMessage component * refactor: normalize ChatTextField component * refactor: normalize ChatUserBadge component * refactor: normalize ChatUserMessage component * refactor: normalize ContentHeader component * refactor: normalize OwncastLogo component * refactor: normalize UserDropdown component * chore(eslint): modify react/function-component-definition rule * refactor: normalize CodecSelector component * refactor: update a bunch of functional components using eslint * refactor: update a bunch of functional components using eslint, pt2 * refactor: update a bunch of functional components using eslint, pt3 * refactor: replace all component->component default imports with named imports * refactor: replace all component-stories->component default imports with named imports * refactor: remove default exports from most components * chore(eslint): add eslint config files for the components and pages dirs * fix: use-before-define error in ChatContainer * Fix ChatContainer import * Only process .tsx files in Next builds Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
/* eslint-disable react/no-unescaped-entities */
|
||||
import { Input, Button, Alert, Spin, Space } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import s from './FollowModal.module.scss';
|
||||
import { FC, useState } from 'react';
|
||||
import styles from './FollowModal.module.scss';
|
||||
|
||||
const ENDPOINT = '/api/remotefollow';
|
||||
|
||||
interface Props {
|
||||
export type FollowModalProps = {
|
||||
handleClose: () => void;
|
||||
account: string;
|
||||
name: string;
|
||||
}
|
||||
};
|
||||
|
||||
function validateAccount(a) {
|
||||
const sanitized = a.replace(/^@+/, '');
|
||||
@@ -18,8 +18,7 @@ function validateAccount(a) {
|
||||
return regex.test(String(sanitized).toLowerCase());
|
||||
}
|
||||
|
||||
export default function FollowModal(props: Props) {
|
||||
const { handleClose, account, name } = props;
|
||||
export const FollowModal: FC<FollowModalProps> = ({ handleClose, account, name }) => {
|
||||
const [remoteAccount, setRemoteAccount] = useState(null);
|
||||
const [valid, setValid] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -76,7 +75,7 @@ export default function FollowModal(props: Props) {
|
||||
|
||||
return (
|
||||
<Space direction="vertical">
|
||||
<div className={s.header}>
|
||||
<div className={styles.header}>
|
||||
By following this stream you'll get notified on the Fediverse when it goes live. Now is a
|
||||
great time to
|
||||
<a href="https://owncast.online/join-fediverse" target="_blank" rel="noreferrer">
|
||||
@@ -89,16 +88,16 @@ export default function FollowModal(props: Props) {
|
||||
{errorMessage && (
|
||||
<Alert message="Follow Error" description={errorMessage} type="error" showIcon />
|
||||
)}
|
||||
<div className={s.account}>
|
||||
<img src="/logo" alt="logo" className={s.logo} />
|
||||
<div className={s.username}>
|
||||
<div className={s.name}>{name}</div>
|
||||
<div className={styles.account}>
|
||||
<img src="/logo" alt="logo" className={styles.logo} />
|
||||
<div className={styles.username}>
|
||||
<div className={styles.name}>{name}</div>
|
||||
<div>{account}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div className={s.instructions}>Enter your username @server to follow</div>
|
||||
<div className={styles.instructions}>Enter your username @server to follow</div>
|
||||
<Input
|
||||
value={account}
|
||||
size="large"
|
||||
@@ -106,11 +105,11 @@ export default function FollowModal(props: Props) {
|
||||
placeholder="Your fediverse account @account@server"
|
||||
defaultValue={account}
|
||||
/>
|
||||
<div className={s.footer}>
|
||||
<div className={styles.footer}>
|
||||
You'll be redirected to your Fediverse server and asked to confirm the action.
|
||||
</div>
|
||||
</div>
|
||||
<Space className={s.buttons}>
|
||||
<Space className={styles.buttons}>
|
||||
<Button disabled={!valid} type="primary" onClick={remoteFollowButtonPressed}>
|
||||
Follow
|
||||
</Button>
|
||||
@@ -121,4 +120,4 @@ export default function FollowModal(props: Props) {
|
||||
</Spin>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user