mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 10:51:36 -04:00
Using Link for channel edit button and Tag label.
This commit is contained in:
parent
6403a106e7
commit
77635b7926
3 changed files with 9 additions and 8 deletions
|
|
@ -14,7 +14,6 @@
|
|||
"react-dom": "^18.2.0",
|
||||
"react-dropzone": "^14.2.3",
|
||||
"react-qr-code": "^2.0.11",
|
||||
"react-reader": "^1.0.2",
|
||||
"react-router-dom": "^6.8.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-semantic-toasts-2": "^0.6.7",
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import _ from "lodash";
|
|||
import {HexColorPicker} from "react-colorful";
|
||||
import {useRecurringTimeout} from "./hooks/customHooks";
|
||||
import {Media} from "./contexts/contexts";
|
||||
import {Link} from "react-router-dom";
|
||||
|
||||
export const TagsContext = React.createContext({
|
||||
NameToTagLabel: null,
|
||||
|
|
@ -109,9 +110,9 @@ export function useTags() {
|
|||
}
|
||||
return <Label.Group tag>
|
||||
{tagNames.map(i =>
|
||||
<a key={i} href={`/?tag=${i}`} style={{marginLeft: '0.3em', marginRight: '0.3em'}}>
|
||||
<Link key={i} to={`/?tag=${i}`} style={{marginLeft: '0.3em', marginRight: '0.3em'}}>
|
||||
<NameToTagLabel name={i} {...props}/>
|
||||
</a>
|
||||
</Link>
|
||||
)}
|
||||
</Label.Group>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ import {
|
|||
Table
|
||||
} from "./Theme";
|
||||
import Dropdown from "semantic-ui-react/dist/commonjs/modules/Dropdown";
|
||||
import {Media} from "../contexts/contexts";
|
||||
import {Media, ThemeContext} from "../contexts/contexts";
|
||||
import {SortableTable} from "./SortableTable";
|
||||
import {ChannelPlaceholder} from "./Placeholder";
|
||||
import {toast} from "react-semantic-toasts-2";
|
||||
|
|
@ -436,11 +436,12 @@ export function NewChannel(props) {
|
|||
}
|
||||
|
||||
function ChannelRow({channel}) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const editTo = `/videos/channel/${channel.id}/edit`;
|
||||
const videosTo = `/videos/channel/${channel.id}/video`;
|
||||
|
||||
const {inverted} = React.useContext(ThemeContext);
|
||||
const editTo = `/videos/channel/${channel.id}/edit`;
|
||||
const buttonClass = `ui button secondary ${inverted ? 'inverted' : ''}`;
|
||||
|
||||
return <TableRow>
|
||||
<TableCell>
|
||||
<Link to={videosTo}>{channel.name}</Link>
|
||||
|
|
@ -455,7 +456,7 @@ function ChannelRow({channel}) {
|
|||
{channel.url && channel.download_frequency ? secondsToFrequency(channel.download_frequency) : null}
|
||||
</TableCell>
|
||||
<TableCell textAlign='right'>
|
||||
<Button secondary onClick={() => navigate(editTo)}>Edit</Button>
|
||||
<Link className={buttonClass} to={editTo}>Edit</Link>
|
||||
</TableCell>
|
||||
</TableRow>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue