Customize the new chat and space button in home screen

This commit is contained in:
Letro Bot
2026-04-01 22:57:36 +03:00
parent 1896637645
commit 45808fb72d
5 changed files with 78 additions and 12 deletions

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "letro-icon-new.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,22 @@
<svg width="24" height="23" viewBox="0 0 24 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="24" height="23" rx="4" fill="url(#paint0_linear_9640_24844)"/>
<g clip-path="url(#clip0_9640_24844)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0002 5.42993C12.2756 5.42993 12.4989 5.65323 12.4989 5.92868V10.964H17.5714C17.8469 10.964 18.0702 11.1873 18.0702 11.4628C18.0702 11.7382 17.8469 11.9615 17.5714 11.9615H12.4989V17.0712C12.4989 17.3466 12.2756 17.5699 12.0002 17.5699C11.7247 17.5699 11.5014 17.3466 11.5014 17.0712V11.9615H6.42893C6.15347 11.9615 5.93018 11.7382 5.93018 11.4628C5.93018 11.1873 6.15347 10.964 6.42893 10.964H11.5014V5.92868C11.5014 5.65323 11.7247 5.42993 12.0002 5.42993Z" fill="white"/>
</g>
<defs>
<linearGradient id="paint0_linear_9640_24844" x1="0.19128" y1="22.4501" x2="22.4379" y2="-0.763783" gradientUnits="userSpaceOnUse">
<stop offset="0.05" stop-color="#C20000"/>
<stop offset="0.19" stop-color="#C30300"/>
<stop offset="0.32" stop-color="#C60E00"/>
<stop offset="0.45" stop-color="#CB2000"/>
<stop offset="0.57" stop-color="#D33900"/>
<stop offset="0.68" stop-color="#DD5A00"/>
<stop offset="0.8" stop-color="#E98200"/>
<stop offset="0.91" stop-color="#F7B000"/>
<stop offset="0.96" stop-color="#FFC800"/>
</linearGradient>
<clipPath id="clip0_9640_24844">
<rect width="14" height="14" fill="white" transform="translate(5 4.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -37,6 +37,7 @@ internal enum Asset {
internal static let letroHeader2 = ImageAsset(name: "images/letro-header-2")
internal static let letroIconChat = ImageAsset(name: "images/letro-icon-chat")
internal static let letroIconChatSolid = ImageAsset(name: "images/letro-icon-chatSolid")
internal static let letroIconNew = ImageAsset(name: "images/letro-icon-new")
internal static let letroIconSpace = ImageAsset(name: "images/letro-icon-space")
internal static let letroIconSpaceSolid = ImageAsset(name: "images/letro-icon-spaceSolid")
internal static let letroLogoType = ImageAsset(name: "images/letro-logo-type")

View File

@@ -57,12 +57,15 @@ struct HomeScreen: View {
.buttonStyle(.borderless)
}
ToolbarItem(placement: .primaryAction) {
if #available(iOS 26, *) {
// Letro: custom new button
if #available(iOS 26, *) {
ToolbarItem(placement: .primaryAction) {
newRoomButton
} else {
}
.sharedBackgroundVisibility(.hidden)
} else {
ToolbarItem(placement: .primaryAction) {
newRoomButton
.buttonStyle(.compound(.super, size: .toolbarIcon))
}
}
@@ -105,7 +108,10 @@ struct HomeScreen: View {
Button {
context.send(viewAction: .startChat)
} label: {
CompoundIcon(\.plus)
// Letro: custom new button
Image(asset: Asset.Images.letroIconNew)
.resizable()
.frame(width: 32, height: 32)
}
.accessibilityLabel(L10n.actionStartChat)
.accessibilityIdentifier(A11yIdentifiers.homeScreen.startChat)

View File

@@ -118,14 +118,30 @@ struct SpacesScreen: View {
}
.backportSharedBackgroundVisibility(.hidden)
ToolbarItem(placement: .navigationBarTrailing) {
Button {
context.send(viewAction: .createSpace)
} label: {
CompoundIcon(\.plus)
.accessibilityHidden(true)
// Letro: custom new button
if #available(iOS 26, *) {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
context.send(viewAction: .createSpace)
} label: {
Image(asset: Asset.Images.letroIconNew)
.resizable()
.frame(width: 32, height: 32)
.accessibilityHidden(true)
}
.accessibilityLabel(L10n.actionCreateSpace)
}
.sharedBackgroundVisibility(.hidden)
} else {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
context.send(viewAction: .createSpace)
} label: {
Image(asset: Asset.Images.letroIconNew)
.accessibilityHidden(true)
}
.accessibilityLabel(L10n.actionCreateSpace)
}
.accessibilityLabel(L10n.actionCreateSpace)
}
}
}