Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ <h2>Try Example Links</h2>
<span class="link-icon">📷</span>
<span class="link-text" style="padding-top: 8px">Instagram Profile</span>
</a>
<a href="#" class="example-link twitter-link" data-url="https://x.com/iamsaban">
<span class="link-icon">𝕏</span>
<span class="link-text">Twitter Profile</span>
</a>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
</div>
</div>

Expand Down
9 changes: 9 additions & 0 deletions apps/demo/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,12 @@ h1 {
white-space: pre-wrap;
word-wrap: break-word;
}

.twitter-link:hover {
border-color: #1DA1F2;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

.instagram-link:hover {
border-color:#833AB4;
}
Comment on lines +246 to +248

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing space after colon.

Line 246 has border-color:#833AB4; without a space after the colon, which is inconsistent with the spacing style used throughout the rest of the file (e.g., lines 104, 108, 242).

🔎 Proposed fix
 .instagram-link:hover {
-  border-color:#833AB4;
+  border-color: #833AB4;
 }

Additionally, while #833AB4 is a valid color from Instagram's gradient, consider using #E1306C (Instagram's signature pink/magenta) for better brand recognition, similar to how Twitter, YouTube, and LinkedIn use their primary brand colors.

Alternative color option
 .instagram-link:hover {
-  border-color:#833AB4;
+  border-color: #E1306C;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.instagram-link:hover {
border-color:#833AB4;
}
.instagram-link:hover {
border-color: #833AB4;
}
🤖 Prompt for AI Agents
In apps/demo/src/style.css around lines 245 to 247, the CSS declaration uses no
space after the colon and thus is inconsistent with the file style; update
`border-color:#833AB4;` to include a space after the colon (`border-color:
#833AB4;`) and, if desired for stronger Instagram brand recognition, replace the
hex with `#E1306C` (`border-color: #E1306C;`) to match other social-icon color
choices.


18 changes: 9 additions & 9 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
instagramHandler,
linkedinHandler,
unknownHandler,
youtubeHandler,
spotifyHandler,
} from './platforms';
import { DeepLinkResult } from './types';
import { instagramHandler, linkedinHandler, unknownHandler, youtubeHandler, twitterHandler, spotifyHandler } from "./platforms";
import { DeepLinkResult } from "./types";

export * from './types';

const handlers = [youtubeHandler, linkedinHandler, instagramHandler, spotifyHandler];
const handlers = [
youtubeHandler,
linkedinHandler,
instagramHandler,
twitterHandler,
spotifyHandler,
];
export function generateDeepLink(url: string): DeepLinkResult {
const webUrl = url.trim();

Expand Down
18 changes: 13 additions & 5 deletions packages/core/src/platforms/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { linkedinHandler } from './linkedin';
import { unknownHandler } from './unknown';
import { youtubeHandler } from './youtube';
import { instagramHandler } from './instagram';
import { linkedinHandler } from "./linkedin";
import { unknownHandler } from "./unknown";
import { youtubeHandler } from "./youtube";
import { instagramHandler } from "./instagram";
import { twitterHandler } from "./twitter";
import { spotifyHandler } from './spotify';

export { linkedinHandler, youtubeHandler, instagramHandler, spotifyHandler, unknownHandler };
export {
linkedinHandler,
youtubeHandler,
instagramHandler,
unknownHandler,
twitterHandler,
spotifyHandler
}
16 changes: 16 additions & 0 deletions packages/core/src/platforms/twitter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// packages/core/src/platforms/twitter.ts
import { DeepLinkHandler } from '../types';

export const twitterHandler: DeepLinkHandler = {
match: (url) => url.match(/x\.com\/([^/?]+)/),

build: (webUrl, match) => {
const username = match[1];
return {
webUrl,
ios: `twitter://user?screen_name=${username}`,
android: `intent://user?screen_name=${username}#Intent;scheme=twitter;package=com.twitter.android;end`,
platform: 'twitter',
};
},
};
2 changes: 1 addition & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type Platform = 'youtube' | 'linkedin' | 'instagram' | 'spotify' | 'unknown';
export type Platform = 'youtube' | 'linkedin' | 'instagram' | 'unknown' | 'twitter' | 'spotify';

export interface DeepLinkResult {
webUrl: string;
Expand Down