Skip to content

Conversation

@DonChiaQE
Copy link
Collaborator

No description provided.


import SwiftUI

struct WorkshopDetailsView: View {
Copy link
Contributor

Choose a reason for hiding this comment

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

let's make this just DetailView and have the SwiftUI previews

MACOSX_DEPLOYMENT_TARGET = 12.3;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.niveumlabs.deepa;
PRODUCT_BUNDLE_IDENTIFIER = com.donchia.deepa;
Copy link
Contributor

Choose a reason for hiding this comment

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

woops, don't commit this lol

ForEach(viewModel.schedule) { information in
if Self.extractDate.string(from: information.startAt ?? Date.now) == "20/01/2022" {
VStack {
NavigationLink(destination: WorkshopDetailsView(title: information.title, startAt: information.startAt ?? Date.now, endAt: information.endAt ?? Date.now, talkDescription: information.talkDescription ?? "", activityName: information.activityName ?? "", speakers: information.speakers)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you rename information to talk? structurally, a schedule is made up of talks.
then ... WorkshopDetailsView / DetailView takes the entire talk and decides how to render the talk

if Self.extractDate.string(from: information.startAt ?? Date.now) == "20/01/2022" {
VStack {
NavigationLink(destination: WorkshopDetailsView(title: information.title, startAt: information.startAt ?? Date.now, endAt: information.endAt ?? Date.now, talkDescription: information.talkDescription ?? "", activityName: information.activityName ?? "", speakers: information.speakers)) {
ListContent(title: information.title, speakers: information.speakers, startAt: information.startAt ?? Date.now, endAt: information.endAt ?? Date.now)
Copy link
Contributor

Choose a reason for hiding this comment

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

same as ListContent can be more specific named as TalkContent and takes the entire Talk

.cornerRadius(6)
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to have the preview here too, something like this will be nice

struct WorkshopDetailsView_Previews: PreviewProvider {
    static var previews: some View {
        NavigationView {
            WorkshopDetailsView(
                title: "Awesome talk title",
                startAt: Date(timeIntervalSinceNow: 1),
                endAt: Date(timeIntervalSinceNow: 20),
                talkDescription: "Lorem ipsum",
                activityName: "normalTalk",
                speakers: [
                    Speaker(
                        id: 90,
                        name: "Kale",
                        twitter: "kale",
                        company: "iOS Conf Sg",
                        imageUrl: "https://iosconf.sg/images/organisers/kale.jpeg"
                    )
                ])
        }
    }
}

func getURL2022(speakerImageURL: String) -> String {
if speakerImageURL.count > 0 {
var url = speakerImageURL
for (index, char) in "2022.".enumerated() {
Copy link
Contributor

@vinamelody vinamelody Nov 5, 2022

Choose a reason for hiding this comment

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

LOL this is a big no .... we should fix the backend value instead and not hard coding it

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.

3 participants