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

feat: customize height and width of the certificate #29

Merged
merged 3 commits into from
Jul 28, 2020

Conversation

prabalsingh24
Copy link
Contributor

#26
Screenshot from 2020-07-24 19-53-15

@boss-contributions-bot
Copy link

Thanks @prabalsingh24, for opening the pull request! 🙌

One of our mentors will review the pull request soon. ✅

Star ⭐ this project and tweet 🐦 about your contributions.

@auto-label auto-label bot added the feature label Jul 24, 2020
name: layout.name,
content: layout.content,
params: layout.params,
height: layout.height ? layout.height : 408,
Copy link
Contributor

Choose a reason for hiding this comment

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

layout.height || 408

onChange={e => setEditingLayout({ ...editingLayout, name: e.target.value})}
/>
<label>Width</label>
Copy link
Contributor

Choose a reason for hiding this comment

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

apply class ml-2 for a little margin on left

@@ -55,7 +75,7 @@ export default props => {
/>
</div>
<div className='col-6'>
<iframe srcDoc={editingLayout.content} className='w-100' style={{ height: '75vh' }}>
<iframe srcDoc={editingLayout.content} width={editingLayout.width} height={editingLayout.height}>
Copy link
Contributor

Choose a reason for hiding this comment

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

setting exact width is an issue for us and will create a messy UI, can we calculate the aspect ratio and set a fixed width (w-50) ?

@@ -79,8 +79,8 @@ module.exports = {
template: layout.content,
context: data.substitutions,
options: {
height: '408px',
width: '842px',
height: layout.height ? `${layout.height}px` :'408px',
Copy link
Contributor

Choose a reason for hiding this comment

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

'${+layout.height || 408}px'

@@ -55,7 +75,7 @@ export default props => {
/>
</div>
<div className='col-6'>
<iframe srcDoc={editingLayout.content} className='w-100' style={{ height: '75vh' }}>
<iframe srcDoc={editingLayout.content} className='w-100' style={{height: `${50*editingLayout.height/editingLayout.width}vw`}}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

w-100 here equals 50 percent visible-width (because of col-6 ), hence height = 50*height/width visible width

@jatinkatyal13 jatinkatyal13 merged commit 818d5ba into coding-blocks:master Jul 28, 2020
@boss-contributions-bot
Copy link

Congratualtions @prabalsingh24, your pull request is merged! 🎉

Thanks for your contributions and participating in BOSS 2020. 🙌

You can claim your bounty points here. 💰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants