Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Commits
61cbf775
Commit
61cbf775
authored
3 years ago
by
Albin Henriksson
Browse files
Options
Downloads
Patches
Plain Diff
Fix aspect ratio in editor
parent
3351fbf5
No related branches found
Branches containing commit
No related tags found
1 merge request
!69
Fix aspect ratio in editor
Pipeline
#41236
passed with warnings
3 years ago
Stage: setup
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/src/pages/presentationEditor/components/SlideEditor.tsx
+18
-14
18 additions, 14 deletions
...t/src/pages/presentationEditor/components/SlideEditor.tsx
client/src/pages/presentationEditor/components/styled.tsx
+18
-0
18 additions, 0 deletions
client/src/pages/presentationEditor/components/styled.tsx
with
36 additions
and
14 deletions
client/src/pages/presentationEditor/components/SlideEditor.tsx
+
18
−
14
View file @
61cbf775
...
@@ -4,7 +4,7 @@ import { useAppSelector } from '../../../hooks'
...
@@ -4,7 +4,7 @@ import { useAppSelector } from '../../../hooks'
import
{
ImageComponent
,
TextComponent
}
from
'
../../../interfaces/ApiModels
'
import
{
ImageComponent
,
TextComponent
}
from
'
../../../interfaces/ApiModels
'
import
CheckboxComponent
from
'
./CheckboxComponent
'
import
CheckboxComponent
from
'
./CheckboxComponent
'
import
ImageComponentDisplay
from
'
./ImageComponentDisplay
'
import
ImageComponentDisplay
from
'
./ImageComponentDisplay
'
import
{
SlideEditorContainer
}
from
'
./styled
'
import
{
SlideEditorContainer
,
SlideEditorContainerRatio
,
SlideEditorPaper
}
from
'
./styled
'
import
TextComponentDisplay
from
'
./TextComponentDisplay
'
import
TextComponentDisplay
from
'
./TextComponentDisplay
'
const
SlideEditor
:
React
.
FC
=
()
=>
{
const
SlideEditor
:
React
.
FC
=
()
=>
{
...
@@ -14,19 +14,23 @@ const SlideEditor: React.FC = () => {
...
@@ -14,19 +14,23 @@ const SlideEditor: React.FC = () => {
)
)
return
(
return
(
<
SlideEditorContainer
>
<
SlideEditorContainer
>
{
components
&&
<
SlideEditorContainerRatio
>
components
.
map
((
component
)
=>
{
<
SlideEditorPaper
>
switch
(
component
.
type_id
)
{
{
components
&&
case
ComponentTypes
.
Checkbox
:
components
.
map
((
component
)
=>
{
return
<
CheckboxComponent
key
=
{
component
.
id
}
component
=
{
component
}
/>
switch
(
component
.
type_id
)
{
case
ComponentTypes
.
Text
:
case
ComponentTypes
.
Checkbox
:
return
<
TextComponentDisplay
key
=
{
component
.
id
}
component
=
{
component
as
TextComponent
}
/>
return
<
CheckboxComponent
key
=
{
component
.
id
}
component
=
{
component
}
/>
case
ComponentTypes
.
Image
:
case
ComponentTypes
.
Text
:
return
<
ImageComponentDisplay
key
=
{
component
.
id
}
component
=
{
component
as
ImageComponent
}
/>
return
<
TextComponentDisplay
key
=
{
component
.
id
}
component
=
{
component
as
TextComponent
}
/>
default
:
case
ComponentTypes
.
Image
:
break
return
<
ImageComponentDisplay
key
=
{
component
.
id
}
component
=
{
component
as
ImageComponent
}
/>
}
default
:
})
}
break
}
})
}
</
SlideEditorPaper
>
</
SlideEditorContainerRatio
>
</
SlideEditorContainer
>
</
SlideEditorContainer
>
)
)
}
}
...
...
This diff is collapsed.
Click to expand it.
client/src/pages/presentationEditor/components/styled.tsx
+
18
−
0
View file @
61cbf775
...
@@ -7,11 +7,29 @@ export const SettingsTab = styled(Tab)`
...
@@ -7,11 +7,29 @@ export const SettingsTab = styled(Tab)`
`
`
export
const
SlideEditorContainer
=
styled
.
div
`
export
const
SlideEditorContainer
=
styled
.
div
`
height: 100%;
display: flex;
display: flex;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
background-color: rgba(0, 0, 0, 0.08);
`
export
const
SlideEditorContainerRatio
=
styled
.
div
`
padding-top: 56.25%;
width: 100%;
height: 0;
overflow: hidden;
padding-top: 56.25%;
position: relative;
`
export
const
SlideEditorPaper
=
styled
.
div
`
position: absolute;
top: 0;
left: 0;
width: 100%;
width: 100%;
height: 100%;
height: 100%;
background: white;
`
`
export
const
HiddenInput
=
styled
.
input
`
export
const
HiddenInput
=
styled
.
input
`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment