Skip to content

Dacey/challenge#1

Open
daceynolan wants to merge 2 commits intopublicistco:mainfrom
daceynolan:dacey/challenge
Open

Dacey/challenge#1
daceynolan wants to merge 2 commits intopublicistco:mainfrom
daceynolan:dacey/challenge

Conversation

@daceynolan
Copy link

  • Created types based on the readme: BlockContentType, TextContentType, MediaContentType, and NodeType
  • Recursively render page content based on node types.
  • Created a carousel that periodically slides between the three TextSections
  • Imported @emotion/styled and added basic styling

Screen Shot 2021-03-09 at 3 56 58 PM

const Container = styled.div`
margin-top: 60px;
display: flex;
flex-direction: column;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the allotted time, I was not able to experiment with emotion's annotation but wanted to show that I could use the library.

setTimeout(() => {
if (slideToShow < 3) {
setSlideToShow(slideToShow + 1);
} else {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the allotted time, I was not able to experiment with emotion's annotation but I did include the library and added basic styling to show that I could use the library.

// Handle self-closing tags
if (NodeTag === "img" || NodeTag === "br") {
return <NodeTag {...attributes} />;
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure there is a better way to handle if the element is a self-closing tag. I tried different things and came up with conditionally rendering the self-closing tag.

// export type TextNodeType = {
// type: TextContentType;
// text: string;
// };
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there is a better way to be more explicit based on what attributes are required. Due to the allotted time, I decided to comment out these types, because I was not sure how to effectively use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant