Closed rain2o closed 1 month ago
Here's another location that could benefit from the same changes mentioned above. https://github.com/Myzwer/foothillschurch/blob/effc5bbf81497ae99f0561ab7849412fe9272bfd/resource.php#L63-L76
As a side note - this file also has really messed up indentation making it really difficult to follow.
Also in components/blocks/card.php
, the primary and secondary CTA buttons could probably be simplified into a single block with some conditional classes, just to avoid duplicate HTML that's so similar.
https://github.com/Myzwer/foothillschurch/blob/effc5bbf81497ae99f0561ab7849412fe9272bfd/components/blocks/card.php#L56-L80
These conditions take a minute to understand what's happening.
https://github.com/Myzwer/foothillschurch/blob/effc5bbf81497ae99f0561ab7849412fe9272bfd/linktree.php#L82-L95
They could be simplified a bit. For starters, we could check
hide_button
first andcontinue
if it's true.Then we can remove the
hide_button
condition from these checks.Also, the HTML looks very similar between prioritized and non-prioritized. You could reduce it to one block of code with conditional classes and img tag. You could either do inline conditions like this
or declare the classes like you do in other places
It's just up to personal preference at this point. But the advantage is that you're not duplicating HTML, so any changes will only need to be made once (and reduces likelihood of bugs from changing one and not the other).