Skip to content

Commit

Permalink
Fix Create Guild
Browse files Browse the repository at this point in the history
  • Loading branch information
theADAMJR committed Aug 9, 2021
1 parent bc15c5a commit 977faa0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/modals/create-guild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Modal from './modal';
const CreateGuild: React.FunctionComponent = () => {
const dispatch = useDispatch();
const { register, handleSubmit } = useForm();
const { register: register2, handleSubmit: handleSubmit2 } = useForm();

const submitCreate = (data) => dispatch(createGuild(data.name));
const submitJoin = (data) => dispatch(joinGuild(data.inviteCode));
Expand Down Expand Up @@ -35,11 +36,11 @@ const CreateGuild: React.FunctionComponent = () => {

<h3 className="uppercase font-bold mt-10">Make Your Own</h3>

<form onSubmit={handleSubmit(submitCreate)}>
<form onSubmit={handleSubmit2(submitCreate)}>
<Input
label="Server Name"
name="name"
register={register} />
register={register2} />
<NormalButton className="w-full h-11 mt-8">Create</NormalButton>
</form>
</Modal>
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/components/navigation/sidebar/sidebar-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ import './sidebar-content.scoped.css';

const SidebarContent: React.FunctionComponent = () => {
const dispatch = useDispatch();
const ui = useSelector((s: Store.AppStore) => s.ui);
const { activeGuild, activeChannel } = useSelector((s: Store.AppStore) => s.ui);

const isActive = (c) => c.id === ui.activeChannel?.id;
const channels = ui.activeGuild?.channels.map(c => (
const channels = activeGuild?.channels.map(c => (
<ContextMenuTrigger key={c.id} id={c.id}>
<Link
to={`/channels/${ui.activeGuild!.id}/${c.id}`}
to={`/channels/${activeGuild!.id}/${c.id}`}
className={`
cursor-pointer flex items-center rounded h-8 p-2 pl-3
${isActive(c) && 'active'}`}>
${c.id === activeChannel?.id && 'active'}`}>
<FontAwesomeIcon
className="float-left mr-2 scale-150 muted fill-current"
icon={faHashtag} />
<span className={`${!isActive(c) && 'font'}`}>{c.name}</span>
<span>{c.name}</span>
</Link>
<ChannelMenu channel={c} />
</ContextMenuTrigger>
Expand Down

0 comments on commit 977faa0

Please sign in to comment.