Skip to content

Commit

Permalink
adjust style on SnapInsight
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeRx committed Sep 14, 2022
1 parent 035c2ac commit db60a97
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
27 changes: 23 additions & 4 deletions ui/components/app/confirm-page-container/flask/index.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
.snap-insight {
font-size: 14px;
display: flex;
flex-direction: column;
flex: 1;
overflow-y: auto;
height: 170px;
word-wrap: break-word;
padding: 12px 24px;


&--no-data {
flex-direction: column;
align-content: center;
align-items: center;
justify-content: center;
text-align: center;
margin-top: 40px;
}

&__container {
padding: 0px 24px 12px 24px;
height: 100%;
overflow-y: auto;

&__data {
padding-top: 12px;

.typography {
font-size: 14px;
}
}

&__title {
font-weight: bold;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import { useI18nContext } from '../../../../hooks/useI18nContext';
import { useTransactionInsightSnap } from '../../../../hooks/flask/useTransactionInsightSnap';

export const SnapInsight = ({ transaction, chainId, snapId }) => {
const response = undefined;
// useTransactionInsightSnap({
// transaction,
// chainId,
// snapId,
// });
const response = useTransactionInsightSnap({
transaction,
chainId,
snapId,
});

const data = response?.insights;

Expand All @@ -31,12 +30,14 @@ export const SnapInsight = ({ transaction, chainId, snapId }) => {
{data ? (
<>
{Object.keys(data).length ? (
Object.keys(data).map((key, i) => (
<Box key={i} paddingTop={3}>
<Typography fontWeight="bold">{key}</Typography>
<p>{data[key]}</p>
</Box>
))
<div className="snap-insight__container">
{Object.keys(data).map((key, i) => (
<div className="snap-insight__container__data" key={i}>
<Typography fontWeight="bold">{key}</Typography>
<Typography>{data[key]}</Typography>
</div>
))}
</div>
) : (
<Typography color={COLORS.TEXT_ALTERNATIVE}>
{t('snapsNoInsight')}
Expand Down

0 comments on commit db60a97

Please sign in to comment.