From e3372d2c4c9ec3ef104d18496ff68cae91aa5f50 Mon Sep 17 00:00:00 2001 From: Florence Randaxhe <43472197+FlorenceRandaxhe@users.noreply.github.com> Date: Thu, 21 Aug 2025 15:02:35 +0200 Subject: [PATCH 1/4] added blockquote component --- components/blockquote/Component.php | 40 ++++++++++++++++++ components/blockquote/style.scss | 29 +++++++++++++ components/blockquote/view.blade.php | 6 +++ src/Components/Publishers/Blockquote.php | 54 ++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 components/blockquote/Component.php create mode 100644 components/blockquote/style.scss create mode 100644 components/blockquote/view.blade.php create mode 100644 src/Components/Publishers/Blockquote.php diff --git a/components/blockquote/Component.php b/components/blockquote/Component.php new file mode 100644 index 0000000..4f9562f --- /dev/null +++ b/components/blockquote/Component.php @@ -0,0 +1,40 @@ +text = $text; + $this->author = $author; + } + + /** + * Get the view / contents that represent the component. + */ + public function render(): View|Closure|string + { + return view('components.blockquote'); + } +} diff --git a/components/blockquote/style.scss b/components/blockquote/style.scss new file mode 100644 index 0000000..2bf2891 --- /dev/null +++ b/components/blockquote/style.scss @@ -0,0 +1,29 @@ +.blockquote { + margin: rem(54) 0; + position: relative; + padding-left: rem(20); + + &:after { + content: ""; + position: absolute; + height: 100%; + width: 1px; + background-color: color(text-primary); + left: 0; + top: 0; + bottom: 0 + } + + &__quote { + font-size: rem(18); + line-height: 160%; + } + + &__author { + display: block; + font-size: rem(12); + line-height: 100%; + text-transform: uppercase; + margin-top: rem(20); + } +} diff --git a/components/blockquote/view.blade.php b/components/blockquote/view.blade.php new file mode 100644 index 0000000..cb57f43 --- /dev/null +++ b/components/blockquote/view.blade.php @@ -0,0 +1,6 @@ +
+ {{ $text }} ++ {{ $author }} +
{{ $text }}- {{ $author }} + @if($author) + {{ $author }} + @endif From 45c5900db67589905cd746ec679d768be9c53b35 Mon Sep 17 00:00:00 2001 From: Florence Randaxhe <43472197+FlorenceRandaxhe@users.noreply.github.com> Date: Mon, 25 Aug 2025 11:16:57 +0200 Subject: [PATCH 4/4] updated blockquote component --- components/blockquote/Component.php | 2 +- components/blockquote/Layout.php | 2 +- components/blockquote/style.scss | 7 +++++-- components/blockquote/view.blade.php | 12 ++++++------ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/components/blockquote/Component.php b/components/blockquote/Component.php index 3de8fe0..c2da3ed 100644 --- a/components/blockquote/Component.php +++ b/components/blockquote/Component.php @@ -7,7 +7,7 @@ use Illuminate\View\Component; use Whitecube\BemComponents\HasBemClasses; -class blockquote extends Component +class Blockquote extends Component { use HasBemClasses; diff --git a/components/blockquote/Layout.php b/components/blockquote/Layout.php index 48e9e27..3f42c3b 100644 --- a/components/blockquote/Layout.php +++ b/components/blockquote/Layout.php @@ -50,7 +50,7 @@ public function display(): array return [ DataList::make() ->row('Text', TextComponent::make($this->text)) - ->row('Author', TextComponent::make($this->author ?? '--')), + ->row('Author', TextComponent::make($this->author)), ]; } diff --git a/components/blockquote/style.scss b/components/blockquote/style.scss index 2bf2891..9f6a35f 100644 --- a/components/blockquote/style.scss +++ b/components/blockquote/style.scss @@ -1,7 +1,10 @@ .blockquote { - margin: rem(54) 0; + margin: rem(28) auto; position: relative; padding-left: rem(20); + width: col(6, 12); + display: flex; + flex-direction: column-reverse; &:after { content: ""; @@ -24,6 +27,6 @@ font-size: rem(12); line-height: 100%; text-transform: uppercase; - margin-top: rem(20); + margin-top: rem(12); } } diff --git a/components/blockquote/view.blade.php b/components/blockquote/view.blade.php index 7494575..b3268fd 100644 --- a/components/blockquote/view.blade.php +++ b/components/blockquote/view.blade.php @@ -1,8 +1,8 @@ -
- {{ $text }} -+
++{{ $text }}
+