Advertisement
matt95

StoreRow

May 8th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. struct StoreRow: View {
  2.  
  3. var title: String
  4. var address: String
  5. var city: String
  6. var categories: [String]
  7. var kilometres: Double
  8.  
  9. var body: some View {
  10. ZStack(alignment: .leading) {
  11.  
  12. Color.flatDarkCardBackground
  13. HStack {
  14. ZStack {
  15. Circle()
  16. .fill(
  17. LinearGradient(
  18. gradient: Gradient(colors: [.lightRed, .darkRed]),
  19. startPoint: .topLeading,
  20. endPoint: .bottomTrailing
  21. )
  22. )
  23.  
  24. VStack {
  25. Text("\(kilometres)")
  26. .font(.system(size: 20, weight: .bold))
  27. .foregroundColor(.white)
  28.  
  29. Text("km")
  30. .font(.caption)
  31. .foregroundColor(.white)
  32. }
  33. }
  34. .frame(width: 70, height: 70, alignment: .center)
  35.  
  36. VStack(alignment: .leading) {
  37. Text(title)
  38. .font(.headline)
  39. .fontWeight(.bold)
  40. .lineLimit(2)
  41. .padding(.bottom, 5)
  42.  
  43. Text(address)
  44. .padding(.bottom, 5)
  45.  
  46. HStack(alignment: .center) {
  47. Image(systemName: "mappin")
  48. Text(city)
  49. }
  50. .padding(.bottom, 5)
  51.  
  52. HStack {
  53. ForEach(categories, id: \.self) { category in
  54. CategoryPill(categoryName: category)
  55. }
  56. }
  57.  
  58. }
  59. .padding(.horizontal, 5)
  60. }
  61. .padding(15)
  62. }
  63. .clipShape(RoundedRectangle(cornerRadius: 15))
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement