(for item: (date: Date, words: Int))
| 401 | } |
| 402 | |
| 403 | private func activityTooltip(for item: (date: Date, words: Int)) -> some View { |
| 404 | VStack(spacing: 2) { |
| 405 | Text(Self.activityTooltipDateFormatter.string(from: item.date)) |
| 406 | .font(.system(size: 10, weight: .medium)) |
| 407 | .foregroundStyle(.secondary) |
| 408 | .lineLimit(1) |
| 409 | |
| 410 | Text("\(self.formatNumber(item.words)) \(item.words == 1 ? "word" : "words")") |
| 411 | .font(.system(size: 12, weight: .semibold, design: .rounded)) |
| 412 | .foregroundStyle(.primary) |
| 413 | .lineLimit(1) |
| 414 | } |
| 415 | .padding(.horizontal, 8) |
| 416 | .padding(.vertical, 6) |
| 417 | .background( |
| 418 | RoundedRectangle(cornerRadius: 6) |
| 419 | .fill(self.theme.palette.cardBackground) |
| 420 | .shadow(color: .black.opacity(0.18), radius: 8, y: 3) |
| 421 | ) |
| 422 | .overlay( |
| 423 | RoundedRectangle(cornerRadius: 6) |
| 424 | .stroke(self.theme.palette.cardBorder.opacity(0.6), lineWidth: 1) |
| 425 | ) |
| 426 | .fixedSize() |
| 427 | .allowsHitTesting(false) |
| 428 | } |
| 429 | |
| 430 | // MARK: - Milestones Card |
| 431 |
no test coverage detected