Skip to content

Copy notebook exports via nb header#31

Open
RickGove wants to merge 7 commits into
nextfrom
copy-notebook-exports-via-nb-header
Open

Copy notebook exports via nb header#31
RickGove wants to merge 7 commits into
nextfrom
copy-notebook-exports-via-nb-header

Conversation

@RickGove

@RickGove RickGove commented Aug 4, 2021

Copy link
Copy Markdown

Same as already approved PR, but much better functionality and looks

@RickGove RickGove changed the base branch from dev to next August 4, 2021 09:30
const [state, actions] = useNotebook()
const [documentMenuVisible, setDocumentMenuVisible] = useState()

let exports = []

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

what's the exports purpose?

@RickGove RickGove Aug 16, 2021

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Okay, so it has to be declared as an array, so that the exports can be iterated over. I will change it up though

// { hasMain, notebook, userProfile, notebookId, isOwner }
// )

const fallbackCopyTextToClipboard = (text) => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'd extract this entire logic into a separate function or a custom hook - and i'd also check if there's a copy-to-clipboard package to use instead of hand-crafting it

}

const initCopy = () => {
let exportsAsString = ''

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'd prepare the string in advanced so it can be shown to the user - this can be a large blob of text on some occasions and not necessarily what the user expects.

- Added a modal where you can choose which exports
- Now only shows # of exports
- Copy is using an NPM package
@RickGove RickGove requested a review from elis August 16, 2021 11:20
Comment thread packages/web/src/djitsu/components/notebook-header/index.js Outdated
@RickGove RickGove requested a review from elis August 16, 2021 12:44
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.

2 participants