Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Workshops
Developer workshop
Commits
b4153411
Commit
b4153411
authored
Sep 25, 2020
by
Andy Lamb
Browse files
composer not working. Maybe using default name composer is an issue?
parent
32f07a98
Pipeline
#40638
passed with stage
in 2 minutes and 54 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/app/features/andyTest/components/AndyTestContent.js
View file @
b4153411
...
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
...
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import
AndyTestContentStyled
from
'
../components.styled/AndyTestContent.styled
'
;
import
AndyTestContentStyled
from
'
../components.styled/AndyTestContent.styled
'
;
import
ContentComposer
from
'
~/features/composer/components/Composer
'
;
import
ContentComposer
Andy
from
'
~/features/composer/components/Composer
Andy
'
;
const
AndyTestContent
=
({
className
,
entry
})
=>
{
const
AndyTestContent
=
({
className
,
entry
})
=>
{
if
(
!
entry
)
return
null
;
if
(
!
entry
)
return
null
;
...
@@ -17,7 +17,9 @@ const AndyTestContent = ({ className, entry }) => {
...
@@ -17,7 +17,9 @@ const AndyTestContent = ({ className, entry }) => {
<
div
className
=
"
eventContent
"
>
<
div
className
=
"
eventContent
"
>
<
h1
className
=
"
pageTitle
"
>
{
entry
.
entryTitle
}
<
/h1
>
<
h1
className
=
"
pageTitle
"
>
{
entry
.
entryTitle
}
<
/h1
>
{
entry
.
content
&&
<
ContentComposer
composer
=
{
entry
.
postContent
}
/>
}
{
entry
.
content
&&
(
<
ContentComposerAndy
composer
=
{
entry
.
composer
}
/> /
/
was
postContent
)}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/AndyTestContentStyled
>
<
/AndyTestContentStyled
>
...
...
src/app/features/composer/components.styled/ComposerAndy.styled.js
0 → 100644
View file @
b4153411
import
styled
,
{
css
}
from
'
styled-components
'
;
//import validateProps from '~/utils/validateProps';
//import getIn from '~/utils/getIn';
const
ContentComposerAndyStyled
=
styled
.
div
`
${()
=>
{
return
css
`
.compField {
margin-bottom: 40px;
}
.contentImage {
margin: 0;
padding: 0;
width: 100%;
}
`
;
}}
`
;
export
default
ContentComposerAndyStyled
;
src/app/features/composer/components/ComposerAndy.js
0 → 100644
View file @
b4153411
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
ContentComposerAndyStyled
from
'
../components.styled/ComposerAndy.styled
'
;
// import ContactDetails from '~/features/contactDetails/ContactDetails';
const
ContentComposerAndy
=
({
className
,
composer
})
=>
{
if
(
!
composer
)
return
null
;
return
(
<
ContentComposerAndyStyled
className
=
{
className
}
>
{
composer
.
map
((
field
,
idx
)
=>
{
switch
(
field
.
type
)
{
case
'
image
'
:
return
(
<
figure
className
=
"
compField contentImage
"
key
=
{
idx
}
>
<
img
src
=
{
field
.
value
.
asset
.
sys
.
uri
}
alt
=
{
field
.
value
.
altText
}
/
>
{
field
.
value
.
caption
&&
(
<
figcaption
>
{
field
.
value
.
caption
}
<
/figcaption
>
)}
<
/figure
>
);
case
'
markup
'
:
return
(
<
div
className
=
"
compField markup
"
key
=
{
idx
}
>
{
field
.
value
.
markup
}
<
/div
>
);
case
'
markupHtml
'
:
return
(
<
div
className
=
"
compField markup
"
key
=
{
idx
}
>
{
field
.
value
.
markupHtml
}
<
/div
>
);
default
:
break
;
}
})}
<
/ContentComposerAndyStyled
>
);
};
ContentComposerAndy
.
propTypes
=
{
className
:
PropTypes
.
string
,
composer
:
PropTypes
.
array
,
};
export
default
ContentComposerAndy
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment