Skip to content

Commit

Permalink
Still show other advanced options but not option 4 if isGated
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyuu-jin committed Jan 7, 2025
1 parent 224d32e commit c6f4ce6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface Props {
winePrefix: string
crossoverBottle: string
wineVersion: WineInstallation | undefined
isGated: boolean
}

const userHome = configStore.get('userHome', '')
Expand All @@ -43,7 +44,8 @@ const ModDialog: React.FC<Props> = ({
enableCTAButton,
winePrefix,
wineVersion,
crossoverBottle
crossoverBottle,
isGated
}) => {
const { t } = useTranslation()
const flags = useFlags()
Expand Down Expand Up @@ -246,19 +248,23 @@ const ModDialog: React.FC<Props> = ({
className={styles.step}
style={{ paddingBottom: 'var(--space-xl-fixed)' }}
>
<div className={styles.stepTitle}>
{t('mods.instructions.step4.title', 'Step 4')}
</div>
<div className={styles.stepSubtitle}>
{t('mods.instructions.step4.subtitle', 'Access Code')}
</div>
<span className={styles.stepDescription}>
{t('mods.instructions.step4.description', {
defaultValue:
'Enter the access code to proceed with installing the game.',
newline: '\n'
})}
</span>
{isGated && (
<>
<div className={styles.stepTitle}>
{t('mods.instructions.step4.title', 'Step 4')}
</div>
<div className={styles.stepSubtitle}>
{t('mods.instructions.step4.subtitle', 'Access Code')}
</div>
<span className={styles.stepDescription}>
{t('mods.instructions.step4.description', {
defaultValue:
'Enter the access code to proceed with installing the game.',
newline: '\n'
})}
</span>
</>
)}
{children}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export default React.memo(function InstallModal({
winePrefix={winePrefix}
wineVersion={wineVersion}
crossoverBottle={crossoverBottle}
isGated={selectedChannel?.license_config?.access_codes ?? false}
>
<div style={{ paddingTop: 'var(--space-md)' }}>
{runner === 'hyperplay' && numberOfChannels > 1 ? (
Expand All @@ -318,8 +319,7 @@ export default React.memo(function InstallModal({
gameInfo={gameInfo}
/>
) : null}
{selectedChannel?.license_config?.access_codes &&
accessCodeContent}
{accessCodeContent}
</div>
{hasWine ? (
<WineSelector
Expand Down

0 comments on commit c6f4ce6

Please sign in to comment.