Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
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
56 changes: 22 additions & 34 deletions extensions/azurePublish/src/components/azureProvisionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,20 @@ type ProvisionFormData = {
};

// ---------- Styles ---------- //
type ProvisonActionsStylingProps = {
showSignout: boolean;
};

const AddResourcesSectionName = styled(Text)`
font-size: ${FluentTheme.fonts.mediumPlus.fontSize};
`;

const ProvisonActions = styled.div<ProvisonActionsStylingProps>((props) => ({
display: 'flex',
flexFlow: 'row nowrap',
justifyContent: props.showSignout ? 'space-between' : 'flex-end',
}));

const ConfigureResourcesSectionName = styled(Text)`
font-size: ${FluentTheme.fonts.mediumPlus.fontSize};
font-weight: ${FontWeights.semibold};
Expand Down Expand Up @@ -993,28 +1002,18 @@ export const AzureProvisionDialog: React.FC = () => {
);

const PageFooter = useMemo(() => {
const isSignedInAndCreateCreationType = currentUser && formData.creationType === 'create';
if (page === PageTypes.ChooseAction) {
return (
<div style={{ display: 'flex', flexFlow: 'row nowrap', justifyContent: 'space-between' }}>
{currentUser ? (
<ProvisonActions showSignout={isSignedInAndCreateCreationType}>
{isSignedInAndCreateCreationType ? (
<Persona
secondaryText={formatMessage('Sign out')}
size={PersonaSize.size40}
text={currentUser.name}
onRenderSecondaryText={onRenderSecondaryText}
/>
) : (
<div
style={{ color: 'blue', cursor: 'pointer' }}
onClick={() => {
clearAll();
closeDialog();
logOut();
}}
>
Sign out
</div>
)}
) : null}
<div>
<DefaultButton
style={{ margin: '0 4px' }}
Expand Down Expand Up @@ -1053,30 +1052,19 @@ export const AzureProvisionDialog: React.FC = () => {
}}
/>
</div>
</div>
</ProvisonActions>
);
} else if (page === PageTypes.ConfigProvision) {
return (
<div style={{ display: 'flex', flexFlow: 'row nowrap', justifyContent: 'space-between' }}>
<ProvisonActions showSignout={isSignedInAndCreateCreationType}>
{currentUser ? (
<Persona
secondaryText={formatMessage('Sign out')}
size={PersonaSize.size40}
text={currentUser.name}
onRenderSecondaryText={onRenderSecondaryText}
/>
) : (
<div
style={{ color: 'blue', cursor: 'pointer' }}
onClick={() => {
clearAll();
closeDialog();
logOut();
}}
>
{formatMessage('Sign out')}
</div>
)}
) : null}
<div>
<DefaultButton
style={{ margin: '0 4px' }}
Expand Down Expand Up @@ -1120,12 +1108,12 @@ export const AzureProvisionDialog: React.FC = () => {
}}
/>
</div>
</div>
</ProvisonActions>
);
} else if (page === PageTypes.AddResources) {
return (
<div style={{ display: 'flex', flexFlow: 'row nowrap', justifyContent: 'space-between' }}>
{currentUser ? (
<ProvisonActions showSignout={isSignedInAndCreateCreationType}>
{isSignedInAndCreateCreationType ? (
<Persona
secondaryText={formatMessage('Sign out')}
size={PersonaSize.size40}
Expand Down Expand Up @@ -1180,11 +1168,11 @@ export const AzureProvisionDialog: React.FC = () => {
}}
/>
</div>
</div>
</ProvisonActions>
);
} else if (page === PageTypes.ReviewResource) {
return (
<div style={{ display: 'flex', flexFlow: 'row nowrap', justifyContent: 'space-between' }}>
<ProvisonActions showSignout={isSignedInAndCreateCreationType}>
{currentUser ? (
<Persona
secondaryText={formatMessage('Sign out')}
Expand Down Expand Up @@ -1227,7 +1215,7 @@ export const AzureProvisionDialog: React.FC = () => {
}}
/>
</div>
</div>
</ProvisonActions>
);
} else {
return (
Expand Down