Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factor out new article vs edit article pages #19

Open
cirosantilli opened this issue May 20, 2021 · 1 comment
Open

Factor out new article vs edit article pages #19

cirosantilli opened this issue May 20, 2021 · 1 comment

Comments

@cirosantilli
Copy link

cirosantilli commented May 20, 2021

They are mostly copy paste now:

I'm giving it a shot but stuck at some point, I wanted to do a this.props from getInitialProps to check new at:

import ArticleEditor from "../../components/editor/ArticleEditor";

export default function PublishArticleEditor() {
  return (
    <ArticleEditor new />
  );
};

but I can't use this.props from there. Thinking is hard.

@cirosantilli
Copy link
Author

OK, I managed it as in: ourbigbook/ourbigbook@8c05857 by creating a function that returns a function.

I also made it use ArticleAPI.update in the component rather than raw axios.

Now I'm going to convert to the better new API getStaticProps + getStaticPaths since my repo is a fullstack integration.

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

No branches or pull requests

1 participant