Update media outlet pages to show profile button instead of info icon
Replace the Info icon with a "Profile" button on the Community and Media Outlet pages, linking to user profiles. Update query invalidation predicate to safely handle undefined query keys. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9a264234-c5d7-4dcc-adf3-a954b149b30d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/9a264234-c5d7-4dcc-adf3-a954b149b30d/cEkjo93
This commit is contained in:
4
.replit
4
.replit
@ -38,6 +38,10 @@ externalPort = 3001
|
|||||||
localPort = 38387
|
localPort = 38387
|
||||||
externalPort = 3003
|
externalPort = 3003
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 41311
|
||||||
|
externalPort = 6800
|
||||||
|
|
||||||
[[ports]]
|
[[ports]]
|
||||||
localPort = 41425
|
localPort = 41425
|
||||||
externalPort = 6000
|
externalPort = 6000
|
||||||
|
|||||||
@ -45,7 +45,7 @@ export default function Community() {
|
|||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
predicate: (query) =>
|
predicate: (query) =>
|
||||||
query.queryKey[0]?.toString().startsWith(`/api/media-outlets/${slug}/community`)
|
query.queryKey[0]?.toString().startsWith(`/api/media-outlets/${slug}/community`) ?? false
|
||||||
});
|
});
|
||||||
setIsNewPostOpen(false);
|
setIsNewPostOpen(false);
|
||||||
}
|
}
|
||||||
@ -147,20 +147,19 @@ export default function Community() {
|
|||||||
<span className="text-lg font-bold text-gray-900" data-testid="text-outlet-name-header">
|
<span className="text-lg font-bold text-gray-900" data-testid="text-outlet-name-header">
|
||||||
{outlet.name}
|
{outlet.name}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<Button
|
||||||
type="button"
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setLocation(`/media/${outlet.slug}/report`);
|
setLocation(`/media/${outlet.slug}/report`);
|
||||||
}}
|
}}
|
||||||
className="inline-flex items-center"
|
className="h-auto p-1"
|
||||||
aria-label="View reports"
|
aria-label="View profile"
|
||||||
|
data-testid="button-profile"
|
||||||
>
|
>
|
||||||
<Info
|
Profile
|
||||||
className="h-4 w-4 text-gray-500 cursor-pointer hover:text-gray-700"
|
</Button>
|
||||||
data-testid="icon-info-header"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -218,20 +218,19 @@ export default function MediaOutlet() {
|
|||||||
<span className="text-lg font-bold text-gray-900" data-testid="text-outlet-name-header">
|
<span className="text-lg font-bold text-gray-900" data-testid="text-outlet-name-header">
|
||||||
{outlet.name}
|
{outlet.name}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<Button
|
||||||
type="button"
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setLocation(`/media/${outlet.slug}/report`);
|
setLocation(`/media/${outlet.slug}/report`);
|
||||||
}}
|
}}
|
||||||
className="inline-flex items-center"
|
className="h-auto p-1"
|
||||||
aria-label="View reports"
|
aria-label="View profile"
|
||||||
|
data-testid="button-profile"
|
||||||
>
|
>
|
||||||
<Info
|
Profile
|
||||||
className="h-4 w-4 text-gray-500 cursor-pointer hover:text-gray-700"
|
</Button>
|
||||||
data-testid="icon-info-header"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user