This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div @click.self="promptGoogleLogin"> | |
| <span>Sign-in with Google</span> | |
| <div style="opacity: 0;height: 0;" ref="invisibleSigninBtn"></div> | |
| </div> | |
| </template> | |
| <script lang="ts" setup> | |
| // pnpm add -D @types/google.accounts | |
| /// <reference types='google.accounts' /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct TabGeoData: Identifiable { | |
| let idx: Int | |
| let geoData: GeoData | |
| var id: Int { idx } | |
| } | |
| struct GeoData: Equatable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension View { | |
| @ViewBuilder func isEmpty ( | |
| @ViewBuilder defaultView: () -> some View | |
| ) -> some View { | |
| if self is EmptyView { | |
| defaultView() | |
| } else { | |
| self | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension NSAttributedString { | |
| func attributedStringWithResizedImages(with maxWidth: CGFloat) -> NSAttributedString { | |
| let text = NSMutableAttributedString(attributedString: self) | |
| text.enumerateAttribute( | |
| .attachment, | |
| in: NSMakeRange(0, text.length), | |
| using: { (value, range, _) in | |
| if let attachement = value as? NSTextAttachment { | |
| let image = attachement.image( | |
| forBounds: attachement.bounds, |