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

Added price and creator to description #248

Merged
merged 13 commits into from
Jun 29, 2022

Conversation

MatheusBuss
Copy link
Contributor

@MatheusBuss MatheusBuss commented Jun 13, 2022

What issue does this PR close

Closes #245

Changes Proposed ( a list of new changes introduced by this PR)

Atualizar a funcionalidade do rich link preview para mostrar o preço dos produtos no título da preview

  • Colocar o preço na descrição, antes de começar o texto, e em negrito
  • Mostrar nome do autor

Link do Figma

image

@MatheusBuss MatheusBuss self-assigned this Jun 15, 2022
@MatheusBuss
Copy link
Contributor Author

Eu fiz alguns testes e tenho algumas coisas pra mostrar @juramos-2020, pra complementar a conversa que tivemos no #182.

Teste Telegram WhatsApp
Com negrito 1 Telegram-bold WhatsApp-bold
Com negrito 2 Telegram-strong WhatsApp-bold
Título comprido Telegram-long-title WhatsApp-long-title
Descrição comprida Telegram-long-description WhatsApp-long-description
  1. O negrito não funciona muito bem. No Telegram ele não converte o html e no WhatsApp ele nem mostra quando percebe a tag
  2. Parece que no título temos ao menos duas linhas. Talvez seja bom colocar o preço antes do título, porque assim ainda tem bastante espaço pra mostrar o resto do conteúdo
  3. A descrição parece bem curta no WhatsApp, acho que colocar informações no final não ficaria muito legal. Quem sabe podemos colocar o vendedor no início da descrição.

Fica aqui uma sugestão de como pode ficar (Ainda vamos dar uma olhada nas imagens na cambiatus/lambda-functions#2). O que acham @juramos-2020 e @lucca65?

Telegram WhatsApp
Telegram-suggestion WhatsApp-suggestion

@juramos-2020
Copy link

juramos-2020 commented Jun 16, 2022

Oi Matheus achei ótima a sugestão.
Teria como o compartilhamento do whatsapp ser igual ao do telegram? Na horizontal. A gente consegue definir isso?

@MatheusBuss
Copy link
Contributor Author

Oi @juramos-2020 , tem sim, só que estamos deixando pra ver essa parte das imagens na issue cambiatus/lambda-functions#2, porque daí vamos ter que investigar porque algumas imagens não aparecem e como fazer pra deixar todas elas padronizadas no mesmo tamanho.

@juramos-2020
Copy link

Beleza então 😉👍

@MatheusBuss MatheusBuss marked this pull request as ready for review June 16, 2022 19:30
Copy link
Member

@henriquecbuss henriquecbuss left a comment

Choose a reason for hiding this comment

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

Looks good! Have you tried using markdown syntax to make bold text? That would be surrounding text with double *: This is **bold**

Comment on lines 48 to 56
get_currency = fn community_subdomain ->
case Commune.find_community(%{}, %{subdomain: community_subdomain}, %{}) do
{:ok, community} ->
String.slice(community.symbol, 2, 7)

{:error, reason} ->
{:error, reason}
end
end
Copy link
Member

Choose a reason for hiding this comment

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

Why not get the value directly instead of making a function?

currency = case Commune.find_community(%{}, %{subdomain: community_subdomain}, %{}) do
...

lib/cambiatus_web/controllers/rich_link_controller.ex Outdated Show resolved Hide resolved
@MatheusBuss
Copy link
Contributor Author

MatheusBuss commented Jun 20, 2022

Have you tried using markdown syntax to make bold text?

Also doesn't work :/

image

image

@MatheusBuss MatheusBuss requested a review from lucca65 June 20, 2022 16:43
Co-authored-by: Julien Lucca <julienlucca@gmail.com>
@MatheusBuss MatheusBuss requested a review from lucca65 June 23, 2022 13:34
Copy link
Member

@lucca65 lucca65 left a comment

Choose a reason for hiding this comment

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

Legal bro, essa issue não para de crescer e acho que podemos resolver essa última parte nesse PR mesmo. Tá faltando traduções adequadas para os textos que são exibidos. Podemos ter duas fontes pro idioma:

o header accept-language se tiver presente ou o idioma configurado do usuário em user.language. Se nenhum dos dois estiver preenchido aí sim vamos pro default que é en-US

{:error, _} ->
""
end
end

def create_description(%{description: description, creator: creator}) do
"Vendido por #{creator} - #{md_to_txt(description)}"
Copy link
Member

Choose a reason for hiding this comment

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

Não tenho certeza se o padrão deve ser português. Temos um mecanismo de tradução colocado que você pode ver nos nossos emails. Arquivos dentro de /priv/gettext/ e no lib/cambiatus_web/email.ex podem servir de referência para como fazer!

@MatheusBuss MatheusBuss requested a review from lucca65 June 27, 2022 17:04
Copy link
Member

@lucca65 lucca65 left a comment

Choose a reason for hiding this comment

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

@MatheusBuss MatheusBuss merged commit f6eefb4 into master Jun 29, 2022
@MatheusBuss MatheusBuss deleted the enhancement/rich-link-enhacement branch June 29, 2022 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adicionar preço do produto no título da rich link preview
4 participants