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

[#400] Create Link component #401

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from
Draft

Conversation

ludovic35
Copy link
Member

Note: Please transform - [ ] into - (NA) in the description when things are not applicable

Related issues

Description

Motivation & Context

Types of change

  • New feature (non-breaking change which adds functionality)

Previews

Checklist

Contribution

Accessibility

  • My change follows accessibility good practices

Design

  • My change respects the design guidelines of Orange Unified Design System

Development

  • My change follows the developer guide
  • I checked my changes do not add new SwiftLint warnings
  • I have added unit tests to cover my changes (optional)

Documentation

  • My change introduces changes to the documentation and/or I have updated the documentation accordingly

Checklist (for Core Team only)

  • The evolution have been tested and the project builds for iPhones and iPads
  • Code review has been done by reviewers according to CODEOWNERS file
  • Design review has been done
  • Accessibiltiy review has been done
  • Q/A team has tested the evolution
  • Documentation has been updated if relevant
  • Internal files have been updated if relevant (like CONTRIBUTING, DEVELOP, THIRD_PARTY, CONTRIBUTORS, NOTICE)
  • CHANGELOG has been updated respecting keep a changelog rules and reference the issues
  • The wiki has been updated if needed (optional)

@ludovic35 ludovic35 linked an issue Jan 23, 2025 that may be closed by this pull request
@pylapp pylapp self-assigned this Jan 23, 2025
@ludovic35 ludovic35 force-pushed the 400-create-component---link branch from de33c42 to 70a7fd9 Compare January 23, 2025 12:31
@@ -58,25 +62,36 @@ final class ButtonConfigurationModel: ComponentConfiguration {
}
}

private var coloredSurfaceCodeModifier: String {
Copy link
Member

Choose a reason for hiding this comment

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

Il y a moyen de faire plus simple sans if/else/return mais avec une expression ternaire :

onColoredSurface ? ".oudsColoredSurface(color: Color.orange)" : ""

@@ -88,14 +72,13 @@ private struct ButtonDemo: View {
@Environment(\.theme) private var theme

@StateObject var model: ButtonConfigurationModel
let coloredSurface: Bool

var body: some View {
HStack(alignment: .center) {
Spacer()

// It is not allowed to place a Negative bnutton on colored surface
Copy link
Member

Choose a reason for hiding this comment

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

button au lieu de bnutton

@@ -112,6 +95,6 @@ private struct ButtonDemo: View {
}
.disabled(!model.enabled)
.padding(.all, theme.spaces.spaceFixedMedium)
.modifier(BackgroundModifier(coloredSurface: coloredSurface))
.modifier(DesignToolColoredBackgroundModifier(coloredSurface: model.onColoredSurface))
Copy link
Member

Choose a reason for hiding this comment

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

DesignToolboxColoredBackgroundModifier au lieu de DesignToolColoredBackgroundModifier


// MARK: Initializer

override init() {
Copy link
Member

Choose a reason for hiding this comment

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

Pas besoin de faire des appels à self ici


// MARK: Component Configuration

private var coloredSurfaceCodeModifier: String {
Copy link
Member

Choose a reason for hiding this comment

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

Il y a moyen de faire plus simple sans if/else/return mais avec une expression ternaire :

onColoredSurface ? ".oudsColoredSurface(color: Color.orange)" : ""

}
}

// MARK: - Button Layout
Copy link
Member

Choose a reason for hiding this comment

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

"Link" Layout plutôt ?

self.action = action
}

/// Create a link with an `Arrow` before `OUDSLink.Arrow.back` or after `OUDSLink.Arrow.Next` the text.
Copy link
Member

Choose a reason for hiding this comment

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

Pas compris ta phrase

import Foundation

extension Bundle {
/// The ouds bundle, useful to find resources
Copy link
Member

Choose a reason for hiding this comment

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

"OUDS" et non "ouds"

}
}

struct LinkUnderlineModifier: ViewModifier {
Copy link
Member

Choose a reason for hiding this comment

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

Pourquoi LinkUnderlineModifier n'est pas dans un fichier à part ? Ou alors renommer le fichier qui ne doit plus être "LinktextModifier.swift"

@B3nz01d
Copy link
Collaborator

B3nz01d commented Jan 24, 2025

@ludovic35 in the link component the option "on colored background" is defaulted to off. This is good.
But in the button component this same option is defaulted to on. They should both behave the same and the button option should also be defaulted to off.

@ludovic35
Copy link
Member Author

@ludovic35 in the link component the option "on colored background" is defaulted to off. This is good. But in the button component this same option is defaulted to on. They should both behave the same and the button option should also be defaulted to off.

I will fix that.

Additional rermarks from designer review:

  • add the issue in changelog file (nothing on privious alpha build)
  • multiline text alignment should be leading
  • the undeline grows during transition (pressed to unpressed). It should stay always to 1 point
  • add long text option in configuration to see the link with long text (same for button)
  • align next chevron to bottom

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.

[Component] Create component - Link
3 participants