Skip to content

Commit

Permalink
new custom info chips feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mm-vasyl committed Sep 6, 2024
1 parent 0601bae commit d16f502
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/preview/dist/js/index_bundle.js

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/preview/src/components/AdPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import FolderIcon from "@mui/icons-material/FolderOpen";
import DoneIcon from "@mui/icons-material/Done";
import ClearIcon from "@mui/icons-material/Clear";
import Quality from "@mui/icons-material/CameraEnhance";
import InfoIcon from '@mui/icons-material/Info';

import LoadingButton from "@mui/lab/LoadingButton";

Expand Down Expand Up @@ -156,6 +157,22 @@ export const AdPreview = (props) => {
</>
: <></>
}
{
gsdevtools === "true" && ad.info
? <>
<Box marginBottom="20px" display="flex" flexWrap="wrap" gap="10px" justifyContent="flex-start" className="chips">
{
Object.entries(ad.info).map(([name, value]) => {
return <Tooltip title={name} key={name}>
<Chip icon={<InfoIcon />} label={value} color={"info"} />
</Tooltip>
})
}
</Box>
<Divider light sx={{margin: "20px 0"}} />
</>
: <></>
}
<Box display="flex" flexWrap="wrap" justifyContent="space-between">
<Box>
<Tooltip title="Reload">
Expand Down
3 changes: 3 additions & 0 deletions src/webpack/buildPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ module.exports = async function buildPreview(result, qualities, outputDir) {
},
...additionalOutputs
},
info: (result && result[bundleName])
? result[bundleName].settings.data.settings.info
: undefined
}
})
))
Expand Down
1 change: 1 addition & 0 deletions src/webpack/devServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ ${chalk.grey.bold('-------------------------------------------------------')}
url,
},
},
info: e.data.settings.info
}
})
})
Expand Down
1 change: 1 addition & 0 deletions src/webpack/devServerParallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ ${chalk.grey.bold('-------------------------------------------------------')}
url,
},
},
info: e.data.settings.info
}
})
})
Expand Down

0 comments on commit d16f502

Please sign in to comment.