Skip to content

Commit

Permalink
Hooking up mock backend
Browse files Browse the repository at this point in the history
  • Loading branch information
duvld committed Oct 30, 2024
1 parent c735fb6 commit e548597
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions jsapp/js/components/header/mainHeader.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ const MainHeader = class MainHeader extends React.Component<MainHeaderProps> {
)}

<HeaderTitleEditor asset={asset} isEditable={userCanEditAsset} />

<OrganizationBadge/>
</React.Fragment>
)}

<OrganizationBadge/>

<AccountMenu />

{!isLoggedIn && this.renderLoginButton()}
Expand Down
14 changes: 10 additions & 4 deletions jsapp/js/components/header/organizationBadge.component.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import React from 'react';
import styles from './organizationBadge.module.scss';
import {useOrganizationQuery} from 'jsapp/js/account/stripe.api';

export default function OrganizationBadge() {
return (
<div className={styles.root}>UNHCR TURKEY</div>
);
const orgQuery = useOrganizationQuery();

if (orgQuery.data?.is_mmo) {
return (
<div className={styles.root}>{orgQuery.data.name.toUpperCase()}</div>
);
} else {
return null;
}
}
2 changes: 1 addition & 1 deletion jsapp/js/components/header/organizationBadge.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
padding: 6px 10px;
border-radius: 48px;
font-weight: 600;
font-size: 1em;
font-size: .85em;
line-height: 12px;
margin-right: 20px;
}

0 comments on commit e548597

Please sign in to comment.