Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ node_modules
.env.development.local
.env.test.local
.env.production.local
.env.*

# Testing
coverage
Expand Down
Empty file added 23
Empty file.
6 changes: 5 additions & 1 deletion apps/backend/src/adapters/stripe.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import Stripe from 'stripe'
import { config } from '@/config'

export const stripe = new Stripe(config.services.STRIPE_SECRET_KEY)
// Stripe is optional in development - use a dummy key if not provided
const stripeKey =
config.services.STRIPE_SECRET_KEY || 'sk_test_dummy_key_for_dev'

export const stripe = new Stripe(stripeKey)
1 change: 1 addition & 0 deletions apps/backend/src/http/routes/reviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export async function reviewsRoute(app: FastifyInstance) {
method: 'GET',
url: '/detailed/reviews',
schema: {
operationId: 'getDetailedReviews',
description: 'Get detailed reviews',
tags: [reviewsTag],
query: getReviewsQuerySchema,
Expand Down
27 changes: 22 additions & 5 deletions apps/ios/Plotwist/Plotwist/Extensions/View+Sheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,29 @@

import SwiftUI

// MARK: - UIScreen Extension for Device Corner Radius
extension UIScreen {
/// Returns the display corner radius of the device screen
var deviceCornerRadius: CGFloat {
guard let cornerRadius = value(forKey: "_displayCornerRadius") as? CGFloat else {
return 44 // Fallback for older devices or simulator
}
return cornerRadius
}
}

// MARK: - Sheet Style Configuration
enum SheetStyle {
/// Margem horizontal do sheet flutuante
static let horizontalPadding: CGFloat = 16
/// Raio de arredondamento do sheet
static let cornerRadius: CGFloat = 32
/// Altura extra para compensar o padding (padding * 2)
static let heightOffset: CGFloat = 32
static let horizontalPadding: CGFloat = 8
/// Margem inferior do sheet flutuante
static let bottomPadding: CGFloat = 8
/// Raio de arredondamento do sheet - usa o raio do dispositivo
static var cornerRadius: CGFloat {
UIScreen.main.deviceCornerRadius
}
/// Altura extra para compensar o padding
static let heightOffset: CGFloat = 20
}

// MARK: - Floating Sheet Container
Expand All @@ -31,7 +46,9 @@ struct FloatingSheetContainer<Content: View>: View {
.background(Color.appBackgroundAdaptive)
.clipShape(RoundedRectangle(cornerRadius: SheetStyle.cornerRadius))
.padding(.horizontal, SheetStyle.horizontalPadding)
.padding(.bottom, SheetStyle.bottomPadding)
}
.ignoresSafeArea(.container, edges: .bottom)
}
}

Expand Down
29 changes: 20 additions & 9 deletions apps/ios/Plotwist/Plotwist/Services/ReviewService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ struct ReviewData: Codable {
}
}

// MARK: - Detailed Reviews (for profile)
// MARK: - Detailed Review (for profile reviews list)
struct DetailedReview: Codable, Identifiable {
let id: String
let userId: String
Expand All @@ -442,17 +442,28 @@ struct DetailedReview: Codable, Identifiable {
}

var formattedDate: String {
let formatter = ISO8601DateFormatter()
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
guard let date = formatter.date(from: createdAt) else { return "" }
let displayFormatter = DateFormatter()
displayFormatter.dateStyle = .medium
displayFormatter.timeStyle = .none
return displayFormatter.string(from: date)
let inputFormatter = ISO8601DateFormatter()
inputFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]

guard let date = inputFormatter.date(from: createdAt) else {
// Try without fractional seconds
inputFormatter.formatOptions = [.withInternetDateTime]
guard let date = inputFormatter.date(from: createdAt) else {
return createdAt
}
return formatDate(date)
}
return formatDate(date)
}

private func formatDate(_ date: Date) -> String {
let outputFormatter = DateFormatter()
outputFormatter.dateFormat = "dd/MM/yyyy"
return outputFormatter.string(from: date)
}

var seasonBadge: String? {
guard let season = seasonNumber else { return nil }
guard mediaType == "TV_SHOW", let season = seasonNumber else { return nil }
if let episode = episodeNumber {
return "(S\(String(format: "%02d", season))E\(String(format: "%02d", episode)))"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/ios/Plotwist/Plotwist/Views/Details/ReviewSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct ReviewSheet: View {
.frame(height: 48)
.background(Color.appForegroundAdaptive)
.foregroundColor(.appBackgroundAdaptive)
.cornerRadius(12)
.clipShape(Capsule())
}
.disabled(!isFormValid || isLoading || isDeleting)
.opacity(!isFormValid || isLoading || isDeleting ? 0.5 : 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct ProviderCategoryAnimated: View {
private let expandedSpacing: CGFloat = 6

private var displayProviders: [WatchProvider] {
isExpanded ? providers : Array(providers.prefix(5))
providers
}

var body: some View {
Expand Down Expand Up @@ -199,19 +199,6 @@ struct ProviderIconsLayout: View {
}
}

// Show +N badge when collapsed and more than 5 providers
if !isExpanded && allProviders.count > 5 {
Text("+\(allProviders.count - 5)")
.font(.caption.weight(.semibold))
.foregroundColor(.appMutedForegroundAdaptive)
.frame(width: iconSize, height: iconSize)
.background(Color.appInputFilled)
.clipShape(RoundedRectangle(cornerRadius: cornerRadius))
.overlay(
RoundedRectangle(cornerRadius: cornerRadius)
.stroke(Color.appBorderAdaptive, lineWidth: 1.5)
)
}
}
}
}
Expand Down
Loading
Loading