Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issues #648

Merged
merged 5 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/components/CreateBoard/TipBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ const UnorderedList = styled('ul', { paddingInlineStart: '$26' });
const CreateBoardTipBar = () => (
<Flex
direction="column"
justify="center"
css={{
minHeight: 'calc(100vh - $sizes$92)',
backgroundColor: '$primary800',
padding: '$32',
pt: '$100',
maxWidth: '$384',
position: 'fixed',
right: 0,
top: 0,
bottom: 0,
zIndex: 1,
}}
>
<Icon
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/components/Sidebar/partials/Content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,7 @@ const SideBarContent: React.FC<SidebarContentProps> = ({ strategy }) => {
</Tooltip>

<StyledSeparator />
<StyledMenuItem
align="center"
css={{ mt: '$16' }}
data-active={active === TEAMS_ROUTE}
onClick={handleSignOut}
>
<StyledMenuItem align="center" css={{ mt: '$16' }} onClick={handleSignOut}>
<Icon name="log-out" />
<StyledText>Log out</StyledText>
</StyledMenuItem>
Expand Down
27 changes: 10 additions & 17 deletions frontend/src/hooks/useTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,17 @@ const useTeam = ({ autoFetchTeam = false }: AutoFetchProps): UseTeamType => {
},
});

const fetchTeam = useQuery(
['team', teamId],
() => {
if (typeof teamId === 'string') return getTeamRequest(teamId);
return undefined;
},
{
enabled: autoFetchTeam,
refetchOnWindowFocus: false,
onError: () => {
setToastState({
open: true,
content: 'Error getting the team',
type: ToastStateEnum.ERROR,
});
},
const fetchTeam = useQuery(['team', teamId], () => getTeamRequest(teamId), {
enabled: autoFetchTeam,
refetchOnWindowFocus: false,
onError: () => {
setToastState({
open: true,
content: 'Error getting the team',
type: ToastStateEnum.ERROR,
});
},
);
});

const fetchTeamsOfUser = useQuery(['teams'], () => getTeamsOfUser(), {
enabled: autoFetchTeam,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/hooks/useTeamUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ToastStateEnum } from '../utils/enums/toast-types';

type TeamUtilsType = {
userId: string;
teamId: string | string[] | undefined;
teamId: string;
queryClient: QueryClient;
setToastState: SetterOrUpdater<{ open: boolean; type: ToastStateEnum; content: string }>;
router: NextRouter;
Expand Down Expand Up @@ -40,7 +40,7 @@ const useTeamUtils = (): TeamUtilsType => {

return {
userId,
teamId,
teamId: String(teamId),
queryClient,
setToastState,
router,
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/pages/boards/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ const NewBoard: NextPage = () => {
>
Cancel
</Button>
<Button type="submit">Create board</Button>
<Button type="submit" disabled={isBackButtonDisable}>
Create board
</Button>
</ButtonsContainer>
</StyledForm>
</SubContainer>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/teams/[teamId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const Team = () => {
};

export const getServerSideProps: GetServerSideProps = async (context) => {
const { teamId } = context.query;
const teamId = String(context.query.teamId);

const queryClient = new QueryClient();
try {
Expand All @@ -83,6 +83,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
}
return {
props: {
key: teamId,
dehydratedState: dehydrate(queryClient),
},
};
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/styles/pages/boards/new.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ const PageHeader = styled('header', {
height: '$92',
width: '100%',

position: 'sticky',
top: 0,
zIndex: 1,
zIndex: 3,
borderBottom: '0.8px solid $primary200',
display: 'flex',
alignItems: 'center',
Expand Down