Skip to content

Commit

Permalink
Display Google auth button only if the directory type is google (#2364
Browse files Browse the repository at this point in the history
)

Display Google button only if the directory type is google
  • Loading branch information
Kiran K authored Feb 29, 2024
1 parent 952bfe3 commit 2d4617d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal-ui/src/dsync/DirectoryInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const DirectoryInfo = ({
<>
<PageHeader title={directory.name} />
{!hideTabs && <DirectoryTab activeTab='directory' baseUrl={urls.tabBase} />}
{!authorizedGoogle && displayGoogleAuthButton && (
{directory.type === 'google' && !authorizedGoogle && displayGoogleAuthButton && (
<div className='mt-5'>
<Alert variant='success' className='bg-white border-error'>
<div className='space-y-3'>
Expand Down
6 changes: 2 additions & 4 deletions internal-ui/src/hooks/useDirectory.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import useSWR from 'swr';
import { fetcher } from '../utils';

// TODO:
// Add types to response
import type { Directory } from '../types';

export const useDirectory = (getDirectoryUrl: string) => {
const { data, error, isLoading } = useSWR(getDirectoryUrl, fetcher);

return {
directory: data?.data,
directory: data?.data as Directory,
isLoadingDirectory: isLoading,
directoryError: error,
};
Expand Down

0 comments on commit 2d4617d

Please sign in to comment.