Skip to content

Commit

Permalink
Fix: Add a border to the preview [n/a]
Browse files Browse the repository at this point in the history
  • Loading branch information
pkniazevych committed Jan 22, 2025
1 parent c4292de commit 882c0f4
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions modules/settings/assets/js/layouts/statement-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import MenuItem from '@elementor/ui/MenuItem';
import Select from '@elementor/ui/Select';
import Switch from '@elementor/ui/Switch';
import Typography from '@elementor/ui/Typography';
import { styled } from '@elementor/ui/styles';
import {
CopyLink,
WidgetLoader,
Expand All @@ -24,6 +25,14 @@ import { useEntityRecords } from '@wordpress/core-data';
import { useEffect, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

const StyledPreviewContainer = styled(Box)`
padding: 0;
margin-top: ${({ theme }) => theme.spacing(2)};
border-radius: 4px;
border: 1px solid ${({ theme }) => theme.palette.divider};
`;

const StatementLink = () => {
const [disabled, setDisabled] = useState(true);
const [isValidPage, setIsValidPage] = useState(false);
Expand Down Expand Up @@ -97,10 +106,13 @@ const StatementLink = () => {
await save({
ea11y_accessibility_statement_data: accessibilityStatementData,
});
await success('Settings saved');

await success('Changes saved');

setDisabled(true);
} catch (e) {
error('Failed to save settings!');

console.error(e);
}
};
Expand Down Expand Up @@ -208,14 +220,12 @@ const StatementLink = () => {
{__('Preview link in widget', 'pojo-accessibility')}
</Typography>

<Box
<StyledPreviewContainer
id="ea11y-widget-preview--container"
className="ea11y-statement--widget-preview"
padding={0}
marginTop={2}
>
<WidgetLoader />
</Box>
</StyledPreviewContainer>
</Box>
</Box>
</CardContent>
Expand Down

0 comments on commit 882c0f4

Please sign in to comment.