Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions react-web-app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@
-->
<script src="https://sandbox.trustly.one/start/scripts/trustly.js?accessId=%REACT_APP_TRUSTLY_ACCESS_ID%"></script>
<title>Trustly Starter App</title>
<style>
body, #root {
background-color: #ffffff;
color: #000000;
transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
body, #root {
background-color: #000000;
color: #ffffff;
}
}
</style>
</head>

<body>
Expand Down
20 changes: 17 additions & 3 deletions react-web-app/src/SelectBankCard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import { useEffect } from 'react';
import Card from '@mui/material/Card';
import CardContent from '@mui/material/CardContent';
import { Typography } from '@mui/material';
import { Typography, useMediaQuery } from '@mui/material';

export default function SelectBankCard(props) {
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');

const cardStyles = {
minWidth: 275,
maxWidth: 550,
margin: 5,
backgroundColor: prefersDarkMode ? '#000000' : '#ffffff'
};

const typographyStyles = {
fontSize: 14,
color: prefersDarkMode ? '#ffffff' : '#000000'
};

useEffect(() => {
const { establishData, TrustlyOptions } = props;

Expand All @@ -14,9 +28,9 @@ export default function SelectBankCard(props) {
}, [props]);

return (
<Card sx={{ minWidth: 275, maxWidth: 550, margin: 5 }}>
<Card sx={cardStyles}>
<CardContent>
<Typography sx={{ fontSize: 14 }} color='text.secondary' gutterBottom>
<Typography sx={typographyStyles} gutterBottom>
Example of the Select Bank Widget
</Typography>
<div id='widget'></div>
Expand Down
Loading