-
Notifications
You must be signed in to change notification settings - Fork 8
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: improve index and show partners pages design #542
Open
faria-s
wants to merge
11
commits into
develop
Choose a base branch
from
sf/improve-index-and-show-partners-pages-design
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dadd8d1
feat: partners show pages
faria-s d22fb23
fix: partner_card
faria-s 707e2ad
refactor: partners index page
faria-s c182523
Merge branch 'develop' into sf/improve-index-and-show-partners-pages-…
faria-s 942216f
fix: router and icons
faria-s aa15c86
Merge branch 'develop' into sf/improve-index-and-show-partners-pages-…
faria-s eb1502f
fix: avatar color
faria-s 8973aa9
fix: merge conflitct
faria-s d7d57a0
fix: remove unused components
faria-s 7f2057e
fix: code format
faria-s 9feefd7
fix: code format
faria-s File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
lib/atomic_web/live/partner_live/components/partner_card.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
defmodule AtomicWeb.PartnerLive.Components.PartnerCard do | ||
@moduledoc false | ||
use AtomicWeb, :component | ||
|
||
import AtomicWeb.Components.{Avatar, Gradient} | ||
|
||
attr :partner, :map, required: true | ||
|
||
def partner_card(assigns) do | ||
~H""" | ||
<li class="grid h-full w-full rounded-lg border border-zinc-200 hover:bg-zinc-50"> | ||
<div class="h-12 w-full"> | ||
<div class="h-full w-full"> | ||
<.gradient seed={@partner.id} class="rounded-t-lg" /> | ||
</div> | ||
</div> | ||
|
||
<div class="grid w-full"> | ||
<div class="flex flex-grow px-6"> | ||
<div class="relative bottom-6 flex"> | ||
<.avatar color={:light_zinc} class="" name={@partner.name} src={Uploaders.PartnerImage.url({@partner.image, @partner}, :original)} type={:company} size={:xl} /> | ||
</div> | ||
<div class="mt-5 px-4"> | ||
<div class="group relative"> | ||
<p class="text-md line-clamp-1 text-lg font-semibold leading-6 text-zinc-900"><%= @partner.name %></p> | ||
<div class="absolute top-full left-14 mt-2 hidden w-max rounded bg-gray-500 p-1 text-sm text-white opacity-100 transition-opacity duration-300 group-hover:block"><%= @partner.name %></div> | ||
<div class="absolute top-full left-16 mt-1 hidden border-r-4 border-b-4 border-l-4 border-r-transparent border-b-gray-500 border-l-transparent group-hover:block"></div> | ||
</div> | ||
<%= if @partner.location do %> | ||
<div class="z-1 flex items-center gap-x-1 leading-6"> | ||
<.icon name="hero-map-pin" class="my-1 h-4 w-4 text-zinc-400" /> | ||
<p class="text-center text-sm text-blue-400"><%= @partner.location.name %></p> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
<div> | ||
<p class="overflow-hidden truncate overflow-ellipsis whitespace-normal px-10 pb-10 text-xs leading-5 text-zinc-500"> | ||
<%= Enum.map(String.split(@partner.benefits, "\n"), fn phrase -> %> | ||
<%= if String.length(phrase) < 50 do %> | ||
<%= phrase %><br /> | ||
<% else %> | ||
<%= String.slice(phrase, 0..50) <> "..." %> <br /> | ||
<% end %> | ||
<% end) %> | ||
</p> | ||
</div> | ||
</div> | ||
</li> | ||
""" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.