This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-19
Channels
- # aws (2)
- # babashka (4)
- # babashka-sci-dev (7)
- # beginners (92)
- # biff (7)
- # calva (64)
- # cider (2)
- # cljsrn (14)
- # clojure (8)
- # clojure-australia (5)
- # clojure-europe (14)
- # clojure-norway (8)
- # clojure-spec (36)
- # clojurescript (19)
- # component (15)
- # cursive (1)
- # data-science (6)
- # girouette (5)
- # hyperfiddle (3)
- # juxt (5)
- # leiningen (10)
- # lsp (7)
- # malli (12)
- # nbb (90)
- # polylith (1)
- # portal (11)
- # rdf (7)
- # reagent (6)
- # reitit (40)
- # remote-jobs (1)
- # shadow-cljs (21)
- # specter (5)
- # squint (83)
- # tools-deps (17)
- # vim (7)
Hi Everyone, I'm trying to understand how these can be converted into equivalent reagent representation. Any help would be useful. I tried using https://github.com/madvas/jsx-to-clojurescript. But it fails at these places.
const headerSX = {
p: 2.5,
'& .MuiCardHeader-action': { m: '0px auto', alignSelf: 'center' }
};
{/* Which is being used as below. And convertin the CardHeader is straight-forward */}
<CardHeader sx={headerSX} title={<Typography variant="h3">{title}</Typography>} action={secondary} />
Another simplified tag,
<Card
elevation={elevation || 0}
ref={ref}
sx={{
...sx,
borderRadius: 2,
'& pre': {
m: 0,
p: '16px !important',
fontFamily: theme.typography.fontFamily,
fontSize: '0.75rem'
}
}}
>
[:> Card
{:elevation (or elevation 0)
:ref ref
:sx sx}]
To create sx
, I'd gobj/clone
the existing sx
and then gobj/set
"borderRadius"
to 2
and "& pre"
to #js {:m 0 ...}
.something like this?
(doto (gobj/clone sx)
(gobj/set "borderRadius" 2)
(gobj/set "& pre" #js {:m 0 ...}))
I assume it would be similar for the headerSx as well.