Skip to content

Commit 6e55ebf

Browse files
samhere06mohas22
andauthored
Updated NavBar to support uploaded app logo and styling to match new design (#504)
* Updated NavBar to support uploaded app logo and styling to match new design * added banner style based on design --------- Co-authored-by: mohas22 <[email protected]>
1 parent ac30409 commit 6e55ebf

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

packages/react-sdk-components/src/components/designSystemExtension/Banner/Banner.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ export default function Banner(props: BannerProps) {
3838
</div>
3939
</div>
4040
<Grid2 container size={12} className='banner-layout' spacing={1}>
41-
<Grid2 size={{ xs: variantMap[variant][0] }} style={{ padding: '1em' }}>
41+
<Grid2
42+
size={{ xs: variantMap[variant][0] }}
43+
style={{ padding: '1em', backgroundColor: 'var(--app-form-bg-color)', borderRadius: '16px', height: 'fit-content' }}
44+
>
4245
{a}
4346
</Grid2>
4447
<Grid2 size={{ xs: variantMap[variant][1] }} style={{ padding: '1em' }}>

packages/react-sdk-components/src/components/template/AppShell/AppShell.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
8181
const classes = useStyles();
8282
const actionsAPI = pConn.getActionsApi();
8383
const localeReference = pConn.getValue('.pyLocaleReference', ''); // 2nd arg empty string until typedef marked correctly
84-
const [imageBlobUrl, setImageBlobUrl] = useState<string | null>(null);
84+
const [imageBlobUrl, setImageBlobUrl] = useState<string | Blob | null>(null);
8585
// useState for appName and mapChildren - note these are ONLY updated once (on component mount!)
8686
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8787
const [appName, setAppName] = useState('');
@@ -133,8 +133,8 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
133133
}
134134
}, []);
135135

136-
const [iconURL, setIconURL] = useState('');
137-
const [fullIconURL, setFullIconURL] = useState('');
136+
const [iconURL, setIconURL] = useState<string | Blob>('');
137+
const [fullIconURL, setFullIconURL] = useState<string | Blob>('');
138138
useEffect(() => {
139139
// using the default icon then fetch it from the static folder (not auth involved)
140140
if (
@@ -150,8 +150,7 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
150150
// not using default icon to fetch it using the way which uses authentication
151151
else {
152152
PCore.getAssetLoader()
153-
.getSvcImage(portalLogo)
154-
.then(blob => window.URL.createObjectURL(blob))
153+
.getSvcImageUrl(portalLogo)
155154
.then(data => {
156155
setIconURL(data);
157156
setFullIconURL(data);
@@ -165,8 +164,7 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
165164
useEffect(() => {
166165
if (imageKey && portalTemplate === 'wss') {
167166
PCore.getAssetLoader()
168-
.getSvcImage(imageKey)
169-
.then(blob => window.URL.createObjectURL(blob))
167+
.getSvcImageUrl(imageKey)
170168
.then(imagePath => setImageBlobUrl(imagePath));
171169
}
172170
}, []);

packages/react-sdk-components/src/components/template/WssNavBar/WssNavBar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const useStyles = makeStyles(theme => ({
3636
marginRight: theme.spacing(2)
3737
},
3838
appListLogo: {
39-
width: '3.6rem',
40-
filter: 'var(--svg-color)'
39+
width: '100%',
40+
height: '100%'
4141
},
4242
appName: {
4343
marginLeft: theme.spacing(2),
@@ -84,8 +84,8 @@ export default function WssNavBar(props: WssNavBarProps) {
8484

8585
return (
8686
<div id='NavBar' className='nav-bar'>
87-
<AppBar position='static' color='primary'>
88-
<Container maxWidth='xl'>
87+
<AppBar position='fixed' color='primary'>
88+
<Container maxWidth={false}>
8989
<Toolbar disableGutters style={{ justifyContent: 'space-between' }}>
9090
<Button id='appName' style={{ textTransform: 'capitalize' }} onClick={appInfo.onClick}>
9191
<img src={appInfo.imageSrc} className={classes.appListLogo} />

0 commit comments

Comments
 (0)