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

[Feature] Add a readmore component #106

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft

Conversation

Liax
Copy link
Contributor

@Liax Liax commented Jan 10, 2023

Objective

First draft of a readmore component.

To do

  • Add an option to enter one content and crop it
  • Add the length to which it should be cropped
  • Animate the reveal
  • Add an option to not use the animate
  • Be sure that the component is abstract and reusable.
  • Add documentations

@Liax Liax self-assigned this Jan 10, 2023
@Liax Liax added the enhancement New feature or request label Jan 10, 2023
@github-actions
Copy link

github-actions bot commented Jan 10, 2023

Export Size

Unchanged

@studiometa/ui

Name Size Diff
AbstractPrefetch 411 B -
AbstractScrollAnimation 461 B -
AbstractSliderChild 2.38 kB -
Accordion 1.06 kB -
AccordionItem 1.02 kB -
ALL 10.55 kB -
AnchorScrollTo 243 B -
animationScrollWithEase 272 B -
ATOMS 3.26 kB -
Cursor 665 B -
Draggable 327 B -
Figure 707 B -
FigureTwicpics 1.02 kB -
Frame 1.62 kB -
FrameAnchor 201 B -
FrameForm 198 B -
FrameTarget 777 B -
LargeText 492 B -
LazyInclude 418 B -
Menu 1.38 kB -
MenuBtn 230 B -
MenuList 943 B -
Modal 908 B -
ModalWithTransition 1.02 kB -
MOLECULES 6.8 kB -
ORGANISMS 1.68 kB -
Panel 1.26 kB -
PrefetchWhenOver 468 B -
PrefetchWhenVisible 480 B -
PRIMITIVES 632 B -
ScrollAnimation 513 B -
ScrollAnimationChild 650 B -
ScrollAnimationChildWithEase 851 B -
ScrollAnimationParent 712 B -
ScrollAnimationWithEase 711 B -
ScrollReveal 622 B -
Sentinel 217 B -
Slider 2.19 kB -
SliderBtn 2.56 kB -
SliderCount 2.41 kB -
SliderDots 2.63 kB -
SliderDrag 353 B -
SliderItem 678 B -
SliderProgress 2.46 kB -
Sticky 859 B -
TableOfContent 647 B -
TableOfContentAnchor 460 B -
Tabs 625 B -
Transition 387 B -

@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

Merging #106 (6377ec8) into develop (d99c362) will decrease coverage by 0.49%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop     #106      +/-   ##
===========================================
- Coverage    26.64%   26.16%   -0.49%     
===========================================
  Files           46       47       +1     
  Lines         1141     1162      +21     
  Branches       211      216       +5     
===========================================
  Hits           304      304              
- Misses         771      792      +21     
  Partials        66       66              
Flag Coverage Δ
unittests 26.16% <0.00%> (-0.49%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/ui/molecules/Readmore/Readmore.ts 0.00% <0.00%> (ø)
packages/ui/molecules/Slider/SliderBtn.ts 5.26% <0.00%> (-1.88%) ⬇️
packages/ui/atoms/Cursor/Cursor.ts 100.00% <0.00%> (ø)
packages/ui/atoms/Figure/Figure.ts 3.70% <0.00%> (ø)
packages/ui/molecules/Modal/Modal.ts 95.94% <0.00%> (ø)
packages/ui/molecules/Slider/Slider.ts 0.60% <0.00%> (ø)
packages/ui/atoms/LargeText/LargeText.ts 4.16% <0.00%> (ø)
packages/ui/decorators/withTransition.ts 20.00% <0.00%> (ø)
packages/ui/molecules/Slider/SliderCount.ts 33.33% <0.00%> (ø)
packages/ui/atoms/LazyInclude/LazyInclude.ts 4.76% <0.00%> (ø)
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@titouanmathis titouanmathis left a comment

Choose a reason for hiding this comment

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

This is a nice first draft, well done @Liax!

packages/ui/molecules/Readmore/Readmore.js Outdated Show resolved Hide resolved
packages/ui/molecules/Readmore/Readmore.js Outdated Show resolved Hide resolved
packages/ui/molecules/Readmore/Readmore.js Outdated Show resolved Hide resolved
packages/ui/molecules/Readmore/Readmore.js Outdated Show resolved Hide resolved
packages/ui/molecules/Readmore/Readmore.twig Outdated Show resolved Hide resolved
packages/ui/molecules/Readmore/Readmore.twig Outdated Show resolved Hide resolved
packages/ui/molecules/Readmore/Readmore.twig Outdated Show resolved Hide resolved
@titouanmathis titouanmathis changed the title Feature/readmore component [Feature] Add a readmore component Jan 11, 2023
@antoine4livre
Copy link
Contributor

Nice !

*/
hide() {
this.$refs.hiddenContent.classList.add('hidden');
this.$refs.btn.innerHTML = this.$options.btnLabelMore;
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: innerHTML might be unsafe. Consider using textContent instead 😇

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

Successfully merging this pull request may close these issues.

4 participants