Skip to content

Commit

Permalink
feat: Styling
Browse files Browse the repository at this point in the history
  • Loading branch information
anth-volk committed Sep 10, 2024
1 parent a1667c3 commit a0f78b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/layout/MarkdownFormatter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export function PlotlyChartCode({ data, backgroundColor }) {
);
}

export function MarkdownFormatter({ markdown, backgroundColor, dict }) {
export function MarkdownFormatter({ markdown, backgroundColor, dict, pSize }) {
const displayCategory = useDisplayCategory();
const mobile = displayCategory === "mobile";
const renderers = {
Expand Down Expand Up @@ -197,7 +197,7 @@ export function MarkdownFormatter({ markdown, backgroundColor, dict }) {
<p
style={{
fontFamily: "Roboto Serif",
fontSize: mobile ? 16 : 18,
fontSize: pSize ? pSize : mobile ? 16 : 18,
backgroundColor: backgroundColor,
}}
>
Expand Down Expand Up @@ -243,7 +243,7 @@ export function MarkdownFormatter({ markdown, backgroundColor, dict }) {
paddingLeft: 20,
marginBottom: 20,
fontFamily: "Roboto Serif",
fontSize: mobile ? 16 : 18,
fontSize: pSize ? pSize : mobile ? 16 : 18,
}}
>
{children}
Expand All @@ -255,7 +255,7 @@ export function MarkdownFormatter({ markdown, backgroundColor, dict }) {
paddingLeft: 20,
marginBottom: 20,
fontFamily: "Roboto Serif",
fontSize: mobile ? 16 : 18,
fontSize: pSize ? pSize : mobile ? 16 : 18,
}}
>
{children}
Expand Down
8 changes: 7 additions & 1 deletion src/modals/AISoftcodedModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { getExplainerAIPromptContent } from "../pages/household/output/explainer
import { countryApiCall, asyncApiCall } from "../api/call";
import useCountryId from "../hooks/useCountryId";
import LoadingCentered from "../layout/LoadingCentered";
import { MarkdownFormatter } from "../layout/MarkdownFormatter";

// Note that depending on implementation, this may instead be a
// JSON object at runtime, requiring some form of parsing be written in
Expand Down Expand Up @@ -145,6 +146,7 @@ export default function AISoftcodedModal(props) {
resetModalData();



}, [isModalVisible, variable, value, fetchAI])

return (
Expand All @@ -157,9 +159,13 @@ export default function AISoftcodedModal(props) {
Close
</Button>,
]}
width="50%"
>
{isLoading && <LoadingCentered />}
{analysis}
<MarkdownFormatter
markdown={analysis}
pSize={14}
/>
</Modal>
)
}

0 comments on commit a0f78b6

Please sign in to comment.