Link channel to Lemmy page
This commit is contained in:
parent
d59128871e
commit
4af7b8a38c
1 changed files with 24 additions and 21 deletions
|
|
@ -127,13 +127,24 @@ const Channels: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
<div className="ml-4 flex-1">
|
<div className="ml-4 flex-1">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h3 className="text-lg font-medium text-gray-900 truncate">
|
<div className="flex items-center space-x-2 flex-1 min-w-0">
|
||||||
{channel.display_name || channel.name}
|
<h3 className="text-lg font-medium text-gray-900 truncate">
|
||||||
</h3>
|
!{channel.name}@{channel.platform_instance?.url?.replace(/^https?:\/\//, '')}
|
||||||
|
</h3>
|
||||||
|
<a
|
||||||
|
href={`https://${channel.platform_instance?.url?.replace(/^https?:\/\//, '')}/c/${channel.name}`}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-gray-400 hover:text-gray-600 flex-shrink-0"
|
||||||
|
title="View community on Lemmy"
|
||||||
|
>
|
||||||
|
<ExternalLink className="h-4 w-4" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={() => handleToggle(channel.id)}
|
onClick={() => handleToggle(channel.id)}
|
||||||
disabled={toggleMutation.isPending}
|
disabled={toggleMutation.isPending}
|
||||||
className="ml-2"
|
className="ml-2 flex-shrink-0"
|
||||||
title={channel.is_active ? 'Deactivate channel' : 'Activate channel'}
|
title={channel.is_active ? 'Deactivate channel' : 'Activate channel'}
|
||||||
>
|
>
|
||||||
{channel.is_active ? (
|
{channel.is_active ? (
|
||||||
|
|
@ -143,8 +154,8 @@ const Channels: React.FC = () => {
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{channel.display_name && channel.display_name !== channel.name && (
|
{channel.display_name && (
|
||||||
<p className="text-sm text-gray-500">@{channel.name}</p>
|
<p className="text-sm text-gray-500">{channel.display_name}</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -167,21 +178,13 @@ const Channels: React.FC = () => {
|
||||||
{channel.platform_accounts?.length || 0} account{(channel.platform_accounts?.length || 0) !== 1 ? 's' : ''} linked
|
{channel.platform_accounts?.length || 0} account{(channel.platform_accounts?.length || 0) !== 1 ? 's' : ''} linked
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-2">
|
<button
|
||||||
<button
|
onClick={() => setShowAccountModal({ channelId: channel.id, channelName: channel.display_name || channel.name })}
|
||||||
onClick={() => setShowAccountModal({ channelId: channel.id, channelName: channel.display_name || channel.name })}
|
className="text-blue-500 hover:text-blue-600"
|
||||||
className="text-blue-500 hover:text-blue-600"
|
title="Manage accounts"
|
||||||
title="Manage accounts"
|
>
|
||||||
>
|
<Settings className="h-4 w-4" />
|
||||||
<Settings className="h-4 w-4" />
|
</button>
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="text-gray-400 hover:text-gray-500"
|
|
||||||
title="View channel"
|
|
||||||
>
|
|
||||||
<ExternalLink className="h-4 w-4" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{channel.platform_accounts && channel.platform_accounts.length > 0 && (
|
{channel.platform_accounts && channel.platform_accounts.length > 0 && (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue